Starbound as a Service (SaaS)

Ever since the release of Starbound 1.0 I’ve dove back into it. I love the procedurally generated worlds, the platformer boss fights and, of course, playing with others.

Starbound comes with a Linux client AND a dedicated multiplayer server, so it’s basically a given that I would be hosting one. Now, you can run it through Steam, but that gets cumbersome if you want to play, too. So I used steamcmd and a custom systemd file so I can start and stop the server automatically, or with a really intuitive (for a debian or Ubuntu user) command:

$ sudo service starbound start|stop|status

How did I do it? Simple! [1]

Install steamcmd

I usually put custom installed stuff in my /opt directory, so I created a /opt/steamcmd directory and pulled down the steamcmd binary from the Steam CDN.

You can find all of these steps on the starbounder wiki site although it’s a little dated (it’s from before they had a 64bit linux client).

cd /opt
sudo mkdir steamcmd
sudo adduser steam
sudo chown steam:steam steamcmd
su - steam
cd steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -zxvf steamcmd_linux.tar.gz

By the end of this, you’ll have a useable steamcmd install, but with no games installed. So obviously, the next step is to

Install Starbound

In the terminal, run

./steamcmd.sh

Which will put you inside the steamcmd prompt steam>

login 
force_install_dir starbound
app_update 211820
quit

This bit will take a while since it has to download all of the files, so open a new terminal and

Add a systemd config file

in /etc/systemd/system create a file called starbound.service and put this information in it.

[Unit]
Description=starbound
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/steamcmd/starbound/linux
User=steam
Group=steam
ExecStart=/opt/steamcmd/starbound/linux/starbound_server
Restart=always
SyslogIdentifier=Starbound

[Install]
WantedBy=multi-user.target

The two fields you might need to customize here are the WorkingDirectory and the ExeStart paths. Since I have everything installed in /opt/steamcmd/starbound these paths work for me.

Once the starbound steamcmd is installed, you can use

sudo service starbound start

to begin hosting a playable world! If you intend to host over a LAN or even on the internet, you’ll need to make a slight change to the starbound.config file in /opt/steamcmd/starbound/giraffe_storage directory.

Just change these three lines

"gameServerBind" : "::",
"queryServerBind" : "::",
"rconServerBind" : "::",

to your LAN IP. For instance, when I run

ip addr

It shows my IP as 192.168.1.10. So my config file says

"gameServerBind" : "192.168.1.10",
"queryServerBind" : "192.168.1.10",
"rconServerBind" : "192.168.1.10",

Happy exploring!

20160806221559_1

Advertisements
Starbound as a Service (SaaS)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s