How to Set Up an Enshrouded Dedicated Server on Linux

Ben
Ben
@benjislab

Enshrouded is a popular survival crafting game that supports dedicated servers, allowing you to create persistent worlds for you and your friends. While the game itself runs on Windows, you can host a dedicated server on Linux, which often provides better performance and resource utilization for 24/7 operation. This guide walks you through the complete process of setting up an Enshrouded dedicated server on Linux.

System Requirements

Before getting started, ensure your Linux server meets these minimum requirements:

  • CPU: 4 cores (Intel or AMD, 2.5GHz or higher recommended)
  • RAM: 16GB minimum (more for larger player counts)
  • Storage: 20GB available space (SSD recommended)
  • Network: Stable internet connection with ability to forward ports
  • OS: Ubuntu 20.04 or newer (this guide uses Ubuntu, but similar steps apply for other distributions)

Step 1: Install SteamCMD

SteamCMD is a command-line version of the Steam client, which we'll use to download and update the Enshrouded server files.

# Update package list
sudo apt update

# Install required dependencies
sudo apt install software-properties-common
sudo add-apt-repository multiverse
sudo dpkg --add-architecture i386
sudo apt update

# Install SteamCMD and dependencies
sudo apt install steamcmd lib32gcc-s1 libsdl2-2.0-0:i386

Step 2: Create a Dedicated User (Optional but Recommended)

It's good practice to create a separate user for your game server:

sudo useradd -m -s /bin/bash enshrouded
sudo passwd enshrouded

Step 3: Create Server Directory

Create a directory for the Enshrouded server files:

# If using dedicated user:
sudo mkdir -p /home/enshrouded/enshrouded-server
sudo chown enshrouded:enshrouded /home/enshrouded/enshrouded-server

# If using current user:
mkdir -p ~/enshrouded-server

Step 4: Install and Set Up Proton/Wine

Since Enshrouded's dedicated server is Windows-based, we need to use Proton or Wine to run it on Linux.

# Install Wine
sudo apt install wine wine64 winetricks

# Install additional required packages
sudo apt install xvfb cabextract winbind

Step 5: Download Enshrouded Dedicated Server

Now we'll use SteamCMD to download the server:

# Switch to the server user if you created one
# sudo su - enshrouded

# Create a script to automate the download
cat > ~/download_server.txt << EOF
@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
login anonymous
force_install_dir ./enshrouded-server
app_update 2278520 validate
quit
EOF

# Run SteamCMD to download the server
steamcmd +runscript ~/download_server.txt

The Enshrouded dedicated server's app ID is 2278520.

Step 6: Configure Server Settings

Navigate to your server directory and configure the server settings:

cd ~/enshrouded-server

Create or edit the enshrouded_server.json file:

nano enshrouded_server.json

Add the following configuration, adjusting to your preferences:

{
  "name": "My Enshrouded Server",
  "password": "your_password_here",
  "saveDirectory": "./savegame",
  "logDirectory": "./logs",
  "ip": "0.0.0.0",
  "gamePort": 15636,
  "queryPort": 15637,
  "slotCount": 16,
  "enableWhitelist": false,
  "whitelist": [],
  "adminIds": []
}

Configuration Options Explained:

  • name: The server name that will appear in the server list
  • password: Server password (leave blank for no password)
  • saveDirectory: Where your world data will be stored
  • logDirectory: Where server logs will be stored
  • ip: IP to bind to (0.0.0.0 means all available interfaces)
  • gamePort: Main game port (default is 15636)
  • queryPort: Query port for server information (default is 15637)
  • slotCount: Maximum number of players (up to 16)
  • enableWhitelist: Enable/disable the whitelist feature
  • whitelist: List of Steam IDs allowed to connect when whitelist is enabled
  • adminIds: List of Steam IDs with administrative privileges

Step 7: Create a Startup Script

Create a startup script to simplify running the server:

nano ~/start_enshrouded.sh

Add the following content:

#!/bin/bash
cd ~/enshrouded-server
WINEDEBUG=-all WINEPREFIX=~/.enshrouded_server_wine wine64 enshrouded_server.exe

Make the script executable:

chmod +x ~/start_enshrouded.sh

Step 8: Configure Firewall

Make sure to open the required ports in your firewall:

# If using UFW (Ubuntu's default firewall)
sudo ufw allow 15636/udp
sudo ufw allow 15637/udp

You'll also need to forward these ports on your router if the server is behind one.

Step 9: Create a Systemd Service (Optional)

For automatic startup and service management, create a systemd service:

sudo nano /etc/systemd/system/enshrouded.service

Add the following content, adjusting paths as needed:

[Unit]
Description=Enshrouded Dedicated Server
After=network.target

[Service]
Type=simple
User=enshrouded
WorkingDirectory=/home/enshrouded
ExecStart=/home/enshrouded/start_enshrouded.sh
Restart=on-failure
RestartSec=30
KillSignal=SIGINT
TimeoutStopSec=60

[Install]
WantedBy=multi-user.target

Enable and start the service:

sudo systemctl enable enshrouded.service
sudo systemctl start enshrouded.service

Check the service status:

sudo systemctl status enshrouded.service

Step 10: Monitor and Maintain Your Server

Check Server Logs

tail -f ~/enshrouded-server/logs/latest.log

Update Server

To update your server when new patches are released:

steamcmd +runscript ~/download_server.txt

Backup Your World

Regularly back up your world data:

tar -czvf enshrouded_backup_$(date +%Y%m%d).tar.gz ~/enshrouded-server/savegame

Common Issues and Troubleshooting

Server Crashes on Startup

If the server crashes immediately:

  • Check that your Wine/Proton setup is complete
  • Verify that the configuration file is properly formatted JSON
  • Try running with WINEDEBUG=+all to get more detailed logs

Connection Issues

If players can't connect:

  • Verify that ports 15636 and 15637 (UDP) are open in your firewall
  • Check that port forwarding is properly configured on your router
  • Confirm that your server's IP address is correctly specified

Performance Issues

If your server is laggy:

  • Monitor system resources with htop to identify bottlenecks
  • Consider upgrading RAM or switching to an SSD if not already using one
  • Reduce the maximum player count in the configuration

Advanced Configuration

Automated Backups

Create a cron job to automatically back up your world:

crontab -e

Add the following line to back up daily at 3 AM:

0 3 * * * tar -czvf /home/enshrouded/backups/enshrouded_backup_$(date +\%Y\%m\%d).tar.gz /home/enshrouded/enshrouded-server/savegame

Server Restarts

For better long-term stability, consider scheduling regular restarts:

0 6 * * * systemctl restart enshrouded.service

Conclusion

You now have a fully functioning Enshrouded dedicated server running on Linux. This setup provides a stable, efficient platform for hosting your Enshrouded world. Remember to keep your server updated, perform regular backups, and monitor performance to ensure the best experience for all players.

With proper maintenance, your Linux-based Enshrouded server can provide a reliable gaming experience for you and your friends as you explore the shrouded lands together.

Additional Resources