Linode Server Setup

From Necesse Wiki
Revision as of 09:18, 28 August 2022 by Fair (talk | contribs) (Inserted external links)
Jump to navigation Jump to search

Necesse Server - Linode Setup

Disclaimer: I am not a professional Server Admin. You may find that I am not following some best practices. This guide is not meant to cover best practices, it is meant to be quick and easy. Also, I will not be covering how to setup a Linode account or go over anything Linode related other than the steps it takes to complete this guide. If you would like to contribute to this guide (such as securing the server or best practices beyond setting up a basic firewall), please email me at nikluz@pm.me and I will ensure that your contributions are credited. Thanks!

Beginners Section (Commands and Instructions)

Create a Linode

  • Choose your Linux Distribution - In this guide, I will use Debian 11.
  • Choose your region - If you are playing with friends in your area, choose the region closest to you. If you are playing with friends from all around the country or the world, choose a region that works best for everyone.
  • Choose your plan - I was able to use a Shared CPU Plan (Nanode) at $5 a month. The server CPU was running at 10% with just me, so I would recommend this for 10 people or less.
  • Enter a root password - whatever you want.
  • Click "Create Linode"
  • You will be redirected to a page with your server status. Copy the ssh link and wait a few minutes until the server says RUNNING.

Open up a terminal

  • ssh into the server - ssh root@your.server.ip If you are on Windows, you can just click Launch LISH Console from the server page on the Linode website.
  • Run the following commands - Wait for each command to finish before moving to the next one. you may be prompted to press y if you forget the -y flag
  • Update your system - apt update && apt full-upgrade -y
  • Create necesse user - useradd -m necesse
  • Create user password passwd necesse enter password twice
  • Add user to sudo group usermod -a -G sudo necesse
  • Reboot the server - reboot wait a few minutes after this before doing the next step
  • ssh into the server as new user - ssh necesse@your.server.ip
  • Install some Necesseities - sudo apt install tmux ufw unzip openjdk-11-jdk -y
  • Start a tmux session - sudo tmux
  • Download the Necesse Server files - sudo wget LINK-TO-ZIP-FILE (url may change over time. please make sure to get the latest link from https://necessegame.com/server/ )
  • Extract the contents - sudo unzip necesse-server-linux64-XXXX.zip (<-- please use tab completion here as the file name may vary. Also make sure you are running this on the ZIP FILE and not the extracted directory)
  • Remove zip folder - sudo rm necesse-server-linux64-XXXX.zip (<-- please use tab completion here as the file name may vary. Also make sure you are running this on the ZIP FILE and not the extracted directory)
  • Open port 14159 - sudo netstat -na | grep :14159
  • Allow ssh through firewall - sudo ufw allow ssh
  • Allow port 14159 through firewall - sudo ufw allow 14159
  • Enable firewall - sudo ufw enable
  • Navigate into the parent directory of the StartServer file - cd /necesse-server-linux64-XXXX
  • Give yourself full permission to the java runtime environment - sudo chmod -R g+rwxs ./jre
  • Run it! - sudo sh StartServer-nogui.sh
  • Follow the prompts! Visit Multiplayer for those directions.
  • Detach from tmux session - press CTRL+b then press d Note: tmux is what keeps the server session running in the background after you disconnect from the server
  • Disconnect from server - exit

Advanced Users (Commands Only)

  • apt update && apt full-upgrade -y
  • useradd -m necesse
  • passwd necesse
  • usermod -a -G sudo necesse
  • reboot
  • ssh necesse@your.server.ip
  • sudo apt install tmux ufw unzip openjdk-11-jdk -y
  • sudo tmux
  • sudo wget LINK-TO-ZIP-FILE
  • sudo unzip necesse-server-linux64-XXXX.zip
  • sudo rm necesse-server-linux64-XXXX.zip
  • sudo netstat -na | grep :14159
  • sudo ufw allow ssh
  • sudo ufw allow 14159
  • sudo ufw enable
  • cd /necesse-server-linux64-XXXX
  • sudo chmod -R g+rwxs ./jre
  • sudo sh StartServer-nogui.sh
  • CTRL+b d
  • exit