Wine is an open-source compatibility layer for Linux that allows software originally developed for Windows to run on Linux systems. This is especially important for dedicated game servers that only offer Windows server files, and is often a prerequisite for our other Linux dedicated game server guides. In this guide, we'll show you how to install Wine on your Linux server for the first time. We use Ubuntu as an example, but the process is very similar on other distributions.
First, connect to your Dedicated Server via SSH. If you need help, check out our SSH initial access guide.
Start the installation by making sure the /etc/apt/keyrings/ directory exists, as Wine requires it.
sudo mkdir -pm755 /etc/apt/keyrings
Next, download the Wine GPG key and save it in this directory so the package's authenticity can be verified.
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
You also need to save the WineHQ sources list. Use this ready-made command:
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/dists/$(lsb_release -cs)/winehq-$(lsb_release -cs).sources
Run an update to refresh your package sources and apply the changes.
sudo apt update
Now you can start the main step and install the latest version of Wine. This may take a while.
sudo apt install --install-recommends winehq-staging
Finally, install a few additional packages to help Wine work optimally with your dedicated game server:
sudo apt install cabextract winbind screen xvfb
You've successfully set up the Wine compatibility layer, which lets you run Windows programs on your Linux server. With this important prerequisite in place, you can now install dedicated game servers, even if they were originally built for Windows.
We also recommend checking out the other guides in this section, which show you how to install specific games via SteamCMD and, where needed, Wine for Windows-based dedicated server files.