Linode Server Setup

From Necesse Wiki
Jump to navigation Jump to search

Necesse Server - Linode Setup[edit]

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)[edit]

Create a Linode[edit]

  • 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[edit]

  • 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
  • Upgrade your system (optional) - 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 -y
  • Start a tmux session - tmux
  • Download the Necesse Server files - wget LINK-TO-ZIP-FILE -O nec-server.zip (url may change over time. please make sure to get the latest link from necessegame dot com slash server )
  • Extract the contents - unzip nec-server.zip
  • Remove zip folder - rm nec-server.zip
  • 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-XXXX
  • Give yourself full permission to the java runtime environment - chmod +x ./jre/bin/java
  • Run it! - 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)[edit]

  • apt update -y
  • apt full-upgrade -y (OPTIONAL)
  • useradd -m necesse
  • passwd necesse
  • usermod -a -G sudo necesse
  • reboot
  • ssh necesse@your.server.ip
  • sudo apt install tmux ufw unzip -y
  • tmux
  • wget LINK-TO-ZIP-FILE -O nec-server.zip
  • unzip nec-server.zip
  • rm nec-server.zip
  • sudo ufw allow ssh
  • sudo ufw allow 14159
  • sudo ufw enable
  • cd /necesse-server-XXXX
  • chmod +x ./jre/bin/java
  • ./StartServer-nogui.sh
  • CTRL+b d
  • exit

Useful Tips[edit]

  • List tmux sessions - tmux list-sessions
  • Restore (re-attach) tmux session - tmux attach -t 0
  • Check server log - cat ~/.config/Necesse/latest-server-log.txt