Linux and Windows server setup guides
Common problems and practical setup guides for Windows and Linux servers.
Windows Server expired after 180 days? Server stops on its own?How to rearm a Windows Server evaluation installation.
If a Windows Server evaluation installation reaches its evaluation period, Windows may shut down automatically. The built-in rearm command can reset an eligible evaluation period.
Open Windows PowerShell
Connect to your server and open Windows PowerShell as administrator.
Reset the evaluation period
Run this command:
slmgr -rearmRestart the server
Restart Windows when prompted. The evaluation period is reset if the installation is eligible.
Add and manage Windows Server usersCreate local accounts and assign appropriate Windows groups.
Prerequisites
- Windows Server with Remote Desktop access.
- Administrator rights on the server.
Open Computer Management
Right-click the Windows logo and open Computer Management.
Open Local Users and Groups
Select Local Users and Groups, then open Users.
Create a user
Right-click an empty area in the user list, choose New User, and enter the username and a strong password. Select the password options that match your account policy, then choose Create.
Assign group membership
Open the new user’s Properties, select Member Of, then Add. Enter an appropriate group and use Check Names to verify it.
Confirm the permissions
Use Administrators only when full administrative access is required. Remote Desktop Users grants remote sign-in rights without automatically granting full administrator access.
Linux: Open and close portsManage a Linux server firewall with UFW.
UFW (Uncomplicated Firewall) provides a simple interface for managing firewall rules on Debian and Ubuntu.
Install UFW
Log in to the Linux console and install the firewall:
sudo apt update && sudo apt install ufwAllow a port
For example, allow incoming TCP traffic on port 8080:
sudo ufw allow 8080/tcpDeny a port
To block incoming TCP traffic on port 8080, use:
sudo ufw deny 8080/tcpCheck and manage UFW
Review the firewall rules before enabling UFW:
sudo ufw status
sudo ufw enable
sudo ufw disableInstall Docker on Debian 12Install Docker Engine and verify that the service is running.
Docker provides containers for running applications. Run installation commands as root or prefix them with sudo.
Update packages and install prerequisites
apt update && apt install ca-certificates curl gnupgInstall Docker Engine
The Docker convenience script configures and installs Docker Engine. Review the script and Docker documentation before running it:
curl -fsSL https://get.docker.com | shInstall the Compose plugin
apt install docker-compose-pluginCheck Docker
systemctl status docker
docker --version
docker compose versionSet up an OpenVPN server on DebianInstall and configure OpenVPN with the community installation script.
Prerequisites
- A Debian server (Debian 10 or newer is required by the original guide; use a currently supported release).
- Root access.
Update the system
apt update && apt upgrade -yCheck the public IP (optional)
If you do not know the server IP, check it in your provider dashboard or with a network command such as:
ip addrDownload the installation script
mkdir -p /openvpn && cd /openvpn
wget https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh
chmod 755 openvpn-install.shRun the installer
./openvpn-install.shAnswer the setup prompts
Confirm the public IP if needed. Choose whether to enable IPv6 based on your network, keep the default port if suitable, select a DNS provider, and decline compression and custom encryption settings unless you have a specific reason to change them.
Set up a FiveM serverStep-by-step setup of a FiveM server and txAdmin on Debian.
This guide uses a Linux KVM server and the FiveM Linux installer. Follow the current requirements and licensing terms from Cfx.re.
Prerequisites
- At least 4 CPU cores, 8 GB RAM, and 50 GB storage are recommended.
- A Linux installation (Debian 12 is a suitable example).
- A server key from Cfx.re Keymaster.
Order a server
Choose a KVM package with enough resources for your expected player count.
Install Debian 12
In the dashboard, open your server management page, choose Reinstall, select Debian 12, and confirm. Save the new root password shown after the installation.
Connect over SSH
Install an SSH client such as Termius, create a host using your server IP, use root as the username, and connect with your root password.
Update the system
apt update && apt upgrade -yInstall phpMyAdmin (optional)
Only run third-party installation scripts you have reviewed and trust. This example installs phpMyAdmin:
bash <(curl -s https://raw.githubusercontent.com/JulianGransee/PHPMyAdminInstaller/main/install.sh)Install FiveM
bash <(curl -s https://raw.githubusercontent.com/Squex0978/linux-fiveminstaller/main/fiveminstaller.sh)Configure txAdmin
Open http://YOUR-SERVER-IP:40120 in your browser, follow the setup wizard, create an administrator account, and choose a server template.
Add your Cfx.re server key
Create a server key in Keymaster using your server IP, then add it in txAdmin under Settings → FXServer → License key.
FiveM: Fix ESX Legacy GetSharedObjectRestore compatibility for older resources that use the legacy ESX event.
Some older ESX resources still request the removed `esx:getSharedObject` event. If you maintain the server and need temporary compatibility, update the handler in your ESX resource.
Open shared.lua
On the FiveM server, open:
resources/[esx]/es_extended/shared/shared.luaFind the legacy error handler
Locate the handler that prints the “getSharedObject event no longer exists” error.
Replace the handler
For a server-side handler that provides the ESX object to the callback, use:
AddEventHandler("esx:getSharedObject", function(cb)
cb(ESX)
end)Restart the server
Save the file and restart the FiveM server, then verify that the affected resources load.
Install a TeamSpeak server on LinuxInstall and start the TeamSpeak 3 server on a Linux host.
Prerequisites
- A Linux VPS or root server.
- SSH access and administrator privileges.
Update the system
sudo apt update && sudo apt upgrade -yCreate a server directory
mkdir -p /home/teamspeak
cd /home/teamspeakDownload the TeamSpeak server archive
wget https://files.teamspeak-services.com/releases/server/3.13.7/teamspeak3-server_linux_amd64-3.13.7.tar.bz2Extract the archive
tar xvf teamspeak3-server_linux_amd64-3.13.7.tar.bz2Accept the license and start the server
cd teamspeak3-server_linux_amd64
touch .ts3server_license_accepted
./ts3server_startscript.sh startConnect as administrator
Save the server administrator token printed during the first start. Connect to the server IP in the TeamSpeak client and enter the token when prompted.
Set up a Garry’s Mod server on Debian 12Install and launch a Garry’s Mod dedicated server with SteamCMD.
Prerequisites
- SteamCMD installed.
- Basic SSH knowledge.
- Screen is optional for a persistent terminal session.
Install server files with SteamCMD
In SteamCMD, set the install directory, sign in anonymously, then download and validate the server:
force_install_dir /root/gmod/
login anonymous
app_update 4020 validateCreate a start script
Create /root/gmod/run.sh and add a launch command. Replace the collection placeholder if you use a Workshop collection:
cd /root/gmod
nano run.sh
./srcds_run -game garrysmod -maxplayers 16 +gamemode sandbox +map gm_flatgrass +host_workshop_collection <collection-id>Make the script executable and start the server
chmod u+x /root/gmod/run.sh
cd /root/gmod
./run.shRun in a Screen session (optional)
sudo apt install screen
screen -S gmod
cd /root/gmod && ./run.shSet up a Minecraft Vanilla server on LinuxDownload the server JAR, accept the EULA, and run Minecraft.
Prerequisites
- A Linux VPS or root server with SSH access.
- Java 21 or newer for current Minecraft releases (check the selected release requirements).
- Screen is optional for background sessions.
Create the server directory
mkdir -p minecraft && cd minecraftDownload the server JAR
Download the server file for your selected Minecraft version from the official Minecraft download page. The supplied example URL is version-specific:
wget https://piston-data.mojang.com/v1/objects/84194a2f286ef7c14ed7ce0090dba59902951553/server.jarAccept the Minecraft EULA
Review the Minecraft EULA, then create eula.txt and set `eula=true` only if you agree to it:
printf "eula=true\n" > eula.txtStart the server
Adjust memory to fit the resources available on your server:
java -Xms2G -Xmx2G -jar server.jar noguiRun in Screen (optional)
screen -S minecraft
java -Xms2G -Xmx2G -jar server.jar noguiSet up a Minecraft Purpur server on LinuxRun Purpur, a configurable Paper-based Minecraft server.
Prerequisites
- A Linux server with SSH access.
- Java version matching your chosen Minecraft release.
- Screen is optional for background sessions.
Create a directory and download Purpur
The supplied URL downloads Purpur for Minecraft 1.20.1. Change the version in the URL when needed:
mkdir -p minecraft && cd minecraft
wget -O purpur.jar https://api.purpurmc.org/v2/purpur/1.20.1/latest/downloadAccept the EULA
Review and accept the Minecraft EULA before starting the server:
printf "eula=true\n" > eula.txtStart the server
java -Xms2G -Xmx2G -jar purpur.jar noguiUse a Screen session (optional)
screen -S minecraft
java -Xms2G -Xmx2G -jar purpur.jar noguiSet up a Minecraft Forge server on LinuxInstall Forge and launch a modded Minecraft server.
Prerequisites
- A Linux server with SSH access.
- Java that matches your Minecraft and Forge versions.
- Screen is optional for background sessions.
Create a server directory
mkdir -p minecraft && cd minecraftDownload the Forge installer
Choose a compatible installer from the official Forge site. This is the supplied 1.20.1 example:
wget https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.1.0/forge-1.20.1-47.1.0-installer.jarInstall the server files
java -jar forge-1.20.1-47.1.0-installer.jar --installServerAccept the EULA
Review and accept the Minecraft EULA before starting:
printf "eula=true\n" > eula.txtStart Forge
Use the generated run script (the exact files may vary by Forge version):
chmod +x run.sh
./run.shInstall Kasm WorkspacesDeploy browser-based workspaces using Docker.
Kasm Workspaces streams isolated browser and desktop environments to a browser tab. The commands below refer to the legacy 1.12.0 release from the supplied guide.
Prerequisites
- Minimum example: 2 vCPUs, 4 GB RAM, and 50 GB storage.
- Recommended example: 4 vCPUs, 10 GB RAM, and 60 GB SSD.
- The supplied release lists Ubuntu 22.04 LTS; check current Kasm requirements before installing.
Download and extract the installer
cd /tmp
curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_1.12.0.d4fd8a.tar.gz
tar -xf kasm_release_1.12.0.d4fd8a.tar.gzStart the installation
sudo bash kasm_release/install.sh --accept-eula --swap-size 4096Save the generated credentials
When installation completes, securely save the credentials shown in the terminal. They may not be displayed again.
Open the web interface
Visit https://YOUR-SERVER-IP and sign in using the administrator account and generated password. Change default credentials if prompted, then select a workspace from the Workspaces area.
Install MongoDB on LinuxInstall and verify MongoDB on Ubuntu 22.04 (Jammy).
The repository configuration below targets Ubuntu 22.04 (Jammy) and MongoDB 6.0, which is an older release. Do not use it unchanged on Debian or another Ubuntu release.
Prerequisites
- Ubuntu 22.04 server with root or sudo access.
- A MongoDB version that is still supported for your workload.
Update and install prerequisites
sudo apt update && sudo apt upgrade -y
sudo apt install -y gnupg curlAdd the MongoDB signing key
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-server-6.0.gpgAdd the Ubuntu Jammy repository
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.listInstall MongoDB
sudo apt update
sudo apt install -y mongodb-orgStart and enable the service
sudo systemctl enable --now mongod
sudo systemctl status mongodTest the MongoDB shell
mongoshInstall Nextcloud on Linux with DockerDeploy Nextcloud and MariaDB using Docker Compose.
Prerequisites
- A Linux server with at least 2 GB RAM.
- Docker Engine and the Docker Compose plugin.
- A domain or subdomain is recommended for HTTPS.
Create a working directory
mkdir -p /opt/nextcloud && cd /opt/nextcloudCreate a Compose file
Create compose.yaml and use strong, unique secrets instead of the example placeholders:
services:
db:
image: mariadb:10.11
restart: unless-stopped
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
volumes:
- db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: REPLACE_WITH_A_LONG_RANDOM_ROOT_SECRET
MYSQL_PASSWORD: REPLACE_WITH_A_DIFFERENT_LONG_RANDOM_SECRET
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
app:
image: nextcloud:latest
restart: unless-stopped
ports:
- "8080:80"
depends_on:
- db
volumes:
- nextcloud:/var/www/html
environment:
MYSQL_PASSWORD: REPLACE_WITH_A_DIFFERENT_LONG_RANDOM_SECRET
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
MYSQL_HOST: db
volumes:
nextcloud:
db:Start Nextcloud
docker compose up -dComplete setup
Open http://YOUR-SERVER-IP:8080 and follow the Nextcloud setup wizard to create an administrator account.
Contact Defo Cloud support if you need a hand with your service.
