This wiki page will explain how to create a server on a dedicated machine with only a SSH access. It is highly inspired from this post. The server for this tutorial will be a Linux machine and we will only use a SSH access to the machine.


  • Creating a new user
  • Installing the game
  • Starting the server
    • with screen
    • with an init.d daemon (if you have root)
    • with a systemd unit file (if you have root)

Creating a new user

It is always better to run things in a separated account, so we will create one.

adduser <user>

and then log back with SSH as user or just do a su user and cd /home/user/

Installing the game

So we will use wget for that, if you don't have it, apt-get install wget as root will install it on most deb-based distributions. Then, download the game and unpack it with those commands:

wget -c
mv "Smokin' Guns" sgserver

also, you can do:

cd sgserver
mv smokinguns_dedicated.i386 smokinguns_dedicated
chmod +x smokinguns_dedicated

As you see, we will run the 32bits binaries. If a problem occurs and you need the 64bits binaries, you may compile them yourself or ask them on the forum. Then you should replace the binaries to the 64bits you got.

Finally, just have a look into the .cfg files into ~/sgserver/smokinguns in particuliar read server.cfg.

Starting the server

With screen

Screen is a terminal emulator where you can have some program running even if you aren't logged. It is a really quick solution to start a server. If you don't have it, install screen. To start a server via screen just do type those commands:

cd ~/sgserver/
./smokinguns_dedicated +exec server.cfg +set dedicated "2"

To quit from screen the right way, just do a CTRL-A + D and you can now logout safely. If you want to see it back, just do either:

screen -r


screen -ls
screen -r <id> 

The id is the number that identifies the screen session when you displayed them all in the first command.

With an init.d daemon

With this method, the server can now be used like any other daemon, but you need to do some root work for that matter. So, create a daemon file into /etc/init.d/ with the following content:


# Provides:          sgserver
# Required-Start:    
# Required-Stop:     
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop Smokin'Guns server

RULE="su - user -c"
BIN="/home/user/sgserver/smokinguns_dedicated +set dedicated 2 +set net_port 27960 +set com_hunkmegs 128 +exec server.cfg >/dev/null 2>&1 &"

case "$1" in

 echo "Smokin' Guns server is running..."
 killall $PROC
 echo "Smokin' Guns server is stopped..."
 echo "Usage: $0 start|stop"
exit 0

You need then to do:

chmod +x /etc/init.d/
ln -s /etc/init.d/ /usr/local/bin/sgserver

You can now use your server as a daemon like this:


sgserver start


sgserver stop

With a systemd unit file

It is similar as the previous method, but instead of having a classic BSD-like init system (SysVinit?, Upstart or OpenRC), your linux distribution comes with systemd. One big change is that now, you have the possibility to create a unit file instead of a starting shell script.

For this, you can create a file into /etc/systemd/system/sgserver.service or /usr/lib/systemd/system/sgserver.service with this following content:

Description=Smokin' Guns dedicated server

User=user # account we created
ExecStart=/home/user/sgserver/smokinguns_dedicated +set dedicated 2 +set net_port 27960 +set com_hunkmegs 128 +exec server.cfg


You can now use your server with the commands provided by systemd:


systemctl start sgserver.service


systemctl stop sgserver.service

If you need more commands, you can have a look at the ArchLinux Wiki page.

Last modified 10 years ago Last modified on Aug 26, 2014, 7:35:03 PM