Linux step by step with SSH and Fire Wall - ACEmulator/ACE GitHub Wiki

Setup for letting others access your Linux-based ACE Server. This will work with most distros, Ubuntu 20.04 with a desktop environment was used for the instructions below.

(2025-06: Tested and updated this instruction set on Debian 12.11.0 - DroopyJ)

SSH setup:

More information: https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement

  • Generate a key, shove the public key in OpenSSH format in ~/.authorized_keys This looks like a file containing `ssh_rsa 'DASFASFASVFHDASVFHDASVFDASFDSAFASDFDASFADFSFVASFVDASFVHASDVFHASDVFHADSVFHDASVFHDASV some comment' you'll be able to log in as the user you shove the key into the folder of.
  • If using WinSCP for sftp management, import key using PuTTYgen and save in .ppk format in your .ssh folder as well
  • Check that you can log in without a password (using the key)
  • Use Nano or Vim to edit /etc/ssh/sshd_config
  • Change your ssh port to something other than 22, this isn't a security measure, it is just to avoid getting your logs spammed by bots. Use 2222 if you cannot choose something
  • Optionally set PermitRootLogin to yes, some will argue you should never log in as root to a server some will
  • Set PasswordAuthentication to no, make sure the key works before doing this
  • sudo systemctl restart sshd
  • sudo systemctl status sshd ensure its running

Firewall setup:

  • sudo ufw allow [yoursshport] make sure you rebooted sshd otherwise it won't have your new port and will refuse connections
  • sudo ufw allow 9000 allow game ports
  • sudo ufw allow 9001
  • sudo ufw enable this will enable the firewall, possibly dropping your ssh connection

Once ssh is setup, installation can be done headless

Use SSH + WinSCP/Filezilla to complete the following:

Github

  • Install git sudo apt-get install git
  • Clone the main repository using git clone 'repository URL'
  • Or Optionally Fork Repository and clone using git clone 'repository URL'
  • Install MegaTools sudo apt-get install megatools
  • Download client files from the 'How To Play' instructions `megadl 'link to client files'
  • Create a /DAT/ directory in /ACE/ and place your DAT files there: /ACE/DAT/client_cell_1.dat client_local_English.dat client_portal.dat

MariaDB setup:

  • sudo apt update

  • sudo apt install mariaDB-server

    • sudo mysql_secure_installation, say yes to everything and change the root password
    • sudo mysql -p to login
  • Create 3 databases, ace_auth, ace_shard and ace_world

    • CREATE DATABASE db_name; where db_name is one of the three above
  • Create 3 users, ace_auth, ace_shard and ace_world with respective access to their databases (ideally you'd limit the access further) Now the firewall setup will prevent you from connecting to your DB externally but that is fine, many sql clients will have an option to use an ssh tunnel to connect. For SQL clients, Dbeaver or HeidiSQL are options that support ssh tunnelling.

    • USE db_name Selects the DB
    • CREATE USER 'username'@localhost IDENTIFIED BY 'password'; Creates the user and password
    • GRANT ALL PRIVILEGES ON 'db_name'.* TO 'username'@localhost; To grant privileges only for the DB in use
    • FLUSH PRIVILEGES; It’s crucial to refresh the privileges once new ones have been awarded
    • Check that the users have been created properly: SELECT USER, HOST FROM MYSQL.USER
    • Check that the users have the correct permissions SHOW GRANTS FOR 'user'@'localhost';
    • The server should list the users and grants correctly: GRANT ALL PRIVILEGES ON 'db_name'.* TO 'user_name'@'localhost' IDENTIFIED BY PASSWORD {hashed password}
  • Load AuthenticationBase.sql ShardBase.sql WorldBase.sql for their respective databases. These can be found in the [Database\Base] path.

  • To Load:

    • USE db_name;
    • SOURCE [use the full path to 'AuthenticationBase.sql' 'ShardBase.sql' 'WorldBase.sql'];
  • Run Updates:

    • `../ACE/Database/Updates/' for Authentication, Shard, and World if any updates were included with the project files. Make sure to run these before running the updates that will be downloaded below.
  • Download the latest release of world data, extract and load it into your ace_world database

  • https://github.com/ACEmulator/ACE-World-16PY + https://github.com/ACEmulator/ACE-World-16PY-Patches

These patches are many, it will be useful to create a script to process them

#!/bin/bash

find "$1" -type f -name '*.sql' -print0 | while IFS= read -rd $'\0' file; do
    mysql --verbose --user='username' --password='password' --database='ace_world' < "$file";
done
  • Use is update_script.sh "directory_of_updates_for_16PY"

Dotnet SDK+Runtime V8.0:

  • https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2004, use 8.0

  • Probably will need to do a scripted install of no package exists - https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install

    wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
    chmod +x ./dotnet-install.sh
    ./dotnet-install.sh --channel 8.0
    ./dotnet-install.sh --channel 8.0 --runtime aspnetcore
    
  • Check that dotnet is properly installed

    dotnet --list-sdks
    dotnet --list-runtimes
    
  • If you find that the script did not install, run

    wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
    sudo dpkg -i packages-microsoft-prod.deb
    rm packages-microsoft-prod.deb
    
    sudo apt-get update && \
      sudo apt-get install -y dotnet-sdk-8.0
    
  • If necessary, install the runtime separately:

    sudo apt-get update && \
      sudo apt-get install -y aspnetcore-runtime-8.0
    

Edit Configuration

  • From: /home/asheron/ACE/Source/ACE.Server COPY Config.js.example and rename to Config.js when prompted as a duplicate file, then modify settings, such as DAT folder location, database credentials and other server settings per your needs. (WinSCP if headless comes in handy here)

Build Server

  • In ACE/Source, run dotnet build
  • In ACE/Source/ACE.Server/bin/Debug/net8.0 run dotnet ACE.Server.dll ACE Server should now launch

Leave a Remote Instance Running:

https://linuxize.com/post/how-to-use-linux-screen/

  • Connect to your linux box using ssh
  • screen -S ACE or
  • tmux new -A -s ACE
  • launch ACE in the newly created terminal instance, you can now close your session and ACE will continue to run

ctrl+d does not work with screens when ACE is running to detach. However, you can close the terminal window then reconnect and resume using screen -r ACE or use screen -list to view attachable screens if you named the session something else

Troubleshooting notes:

There are multiple Config.js files within the ACE directory;
/home/asheron/ACE/Source/ACE.Server/Config.js is copied to /ACE/Source/ACE.Server/bin/Debug/net8.0
when run dotnet build is entered. ACE uses the Config.js located in the net8.0 directory.
If you encounter SQL authentication errors while launching, verify your Config.js has the correct credentials in the correct location