###### tags: `other` # minecraft server notes ### ==GCP 配置 minecraft server== #### ---建立server --- (1)建立內部防火牆規則(預設port): 25565 ------GCP亦要設定外部防火牆規則: tcp-25565 -------- (2)更新和升級linux和安裝jdk ```= sudo apt update -y sudo apt upgrade -y ----jdk 查詢安裝版本的網址(https://jdk.java.net/)----- ---可直接更改數字(ex:openjdk-[版本]-jdk)) sudo apt install openjdk-17-jdk -y ``` (3)建立minecraft 資料夾並下載server檔案 ```= //新增資料夾並切換至該目錄 mkdir minecraft-server && cd ./minecraft-server //下載server程式,版本可選(此版本1.18.1) wget https://launcher.mojang.com/v1/objects/125e5adf40c659\ fd3bce3e66e67a16bb49ecc1b9/server.jar !java -jar forge-1.20.1-47.0.19-installer.jar --install ``` (4)同意 eula設定,記得將設定開啟為非正版也可玩 ```= nano eula.txt eula=true ``` (5)切換java版本 ```= sudo update-alternatives --config java #Java--------------- !wget https://download.oracle.com/java/20/latest/jdk-20_linux-x64_bin.deb !sudo apt-get -qqy install ./jdk-20_linux-x64_bin.deb !sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-20/bin/java 2020 ``` (6)建立screen 並執行server程式 ```= sudo screen -S Minecraft-Server java -Xmx1024M -Xms1024M -jar server.jar nogui ``` (7)背景執行 ```= ctrl +A+D ``` :::info 此外還有自動備份指令!!!!! :mega: ==因為懶得打,以下為圖片備份== ### ==參考網址== https://medium.com/@manbobo2012/%E5%9C%A8google-cloud%E6%9E%B6%E8%A8%AD%E4%B8%80%E5%80%8B%E8%87%AA%E5%8B%95%E9%83%A8%E7%BD%B2%E5%92%8C%E8%87%AA%E5%8B%95%E5%82%99%E4%BB%BD%E7%9A%84minecraft-%E5%89%B5%E4%B8%96%E7%A5%9E-%E4%BC%BA%E6%9C%8D%E5%99%A8-8154e0fdef8c ![](https://i.imgur.com/1YA1Ggf.jpg) :::
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up