Setting up a server on Ubuntu Server 15.04 (terminal only)

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
nordemoniac
Engineer
Engineer
Posts: 52
Joined: 11 Jun 2011 18:45

Setting up a server on Ubuntu Server 15.04 (terminal only)

Post by nordemoniac »

Hi!

I need some help to setup a server on an Ubuntu Server with no GUI.

I started out with:

Code: Select all

sudo apt-get build-dep openttd
This seemed to give me all the requirements for installing OpenTTD.
After this I ran:

Code: Select all

wget https://binaries.openttd.org/releases/1.5.1/openttd-1.5.1-linux-ubuntu-trusty-amd64.deb
sudo dpkg -i openttd-1.5.1-linux-ubuntu-trusty-amd64.deb
OpenTTD is now under /usr/games/openttd and /usr/share/games/openttd
Which of these two should I use?
Do I need to download any graphics packs/music etc?

As it's a bit hard to configure everything from the console, is it possible to configure everything (maps, station settings etc) on my Mac the way I would want it on the server, and then copy openttd.cfg to my Linux server and start it from there? That way I don't have to install a GUI on my server.

Are there also some tips on how to automatically stop/start the server on boot with Linux? A script with "screen" as a command? Autosave?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Setting up a server on Ubuntu Server 15.04 (terminal onl

Post by planetmaker »

nordemoniac wrote:Hi!

I need some help to setup a server on an Ubuntu Server with no GUI.

I started out with:

Code: Select all

sudo apt-get build-dep openttd
This seemed to give me all the requirements for installing OpenTTD.
After this I ran:

Code: Select all

wget https://binaries.openttd.org/releases/1.5.1/openttd-1.5.1-linux-ubuntu-trusty-amd64.deb
sudo dpkg -i openttd-1.5.1-linux-ubuntu-trusty-amd64.deb
OpenTTD is now under /usr/games/openttd and /usr/share/games/openttd
Which of these two should I use?
Do I need to download any graphics packs/music etc?

As it's a bit hard to configure everything from the console, is it possible to configure everything (maps, station settings etc) on my Mac the way I would want it on the server, and then copy openttd.cfg to my Linux server and start it from there? That way I don't have to install a GUI on my server.

Are there also some tips on how to automatically stop/start the server on boot with Linux? A script with "screen" as a command? Autosave?
We do not provide headless binaries. Thus if you use one of our pre-fab binaries, (the one you used wget on) you'll need to install an X (GUI) environment on your server (and you could have skipped installing the build dependencies). If you do not want to do that, you need to compile OpenTTD from source (subversion repository) yourself with the configure flag --enable-dedicated (and only then you need the build dependencies which you installed). You can then simply run that binary from the build directory without any need to install it. That is possibly easier when you frequently want to update to the latest release version which might not be too quickly available from the official ubunutu repositories.

You will need a valid graphics base set as it contains more than just graphics, including potentially some information for map generation.

Of course you can generate a cfg file as well as a savegame file and transfer them to your server for usage.
nordemoniac
Engineer
Engineer
Posts: 52
Joined: 11 Jun 2011 18:45

Re: Setting up a server on Ubuntu Server 15.04 (terminal onl

Post by nordemoniac »

Thank you!
Installing the Deb package failed because of lacking dependencies, which is why I installed it.

So "openttd -D" wouldn't work without compiling from source then?

If not; How do I completely remove OpenTTD before reinstalling from source?

Also, will there still be /usr/games and /usr/share/games?

Which to use out of these two? Doesn't matter because the user files are in user library?
Last edited by nordemoniac on 17 Jun 2015 12:35, edited 1 time in total.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Setting up a server on Ubuntu Server 15.04 (terminal onl

Post by planetmaker »

nordemoniac wrote:Thank you!

So "openttd -D" wouldn't work without compiling from source?
Oh, it will work. But our binaries depend on certain shared libraries being present, among them those which are responsible for GUI: SDL, icu, fontconfig, freetype2. Thus you can run it without GUI just fine as long as you installed thesee dependencies. But you can compile OpenTTD yourself such that those dependencies on GUI components does not exist in the binary - on a server without any GUI at all that might make sense :) - depends on how much you value your disk space on the server.
nordemoniac
Engineer
Engineer
Posts: 52
Joined: 11 Jun 2011 18:45

Re: Setting up a server on Ubuntu Server 15.04 (terminal onl

Post by nordemoniac »

planetmaker wrote:
nordemoniac wrote:Thank you!

So "openttd -D" wouldn't work without compiling from source?
Oh, it will work. But our binaries depend on certain shared libraries being present, among them those which are responsible for GUI: SDL, icu, fontconfig, freetype2. Thus you can run it without GUI just fine as long as you installed thesee dependencies. But you can compile OpenTTD yourself such that those dependencies on GUI components does not exist in the binary - on a server without any GUI at all that might make sense :) - depends on how much you value your disk space on the server.
Aha, I get it.

Well, anything that doesn't have to be there...

I'll definitely do a source install, makes more sense as I'm running multiple game servers on the same physical machine.
nordemoniac
Engineer
Engineer
Posts: 52
Joined: 11 Jun 2011 18:45

Re: Setting up a server on Ubuntu Server 15.04 (terminal onl

Post by nordemoniac »

nordemoniac wrote:Thank you!


If not; How do I completely remove OpenTTD before reinstalling from source?
I used "sudo apt-get install remove openttd" then I removed .openttd from user home, and openttd folder from /usr/share/games.
nordemoniac
Engineer
Engineer
Posts: 52
Joined: 11 Jun 2011 18:45

Re: Setting up a server on Ubuntu Server 15.04 (terminal onl

Post by nordemoniac »

I've done the following:

Code: Select all

./configure --enable-dedicated
make --jobs=9
It's now finished, what do I do next?

"<code>make install" what is "code" here?

Also, I guess I still have to manually copy zBase or similar to get 32bpp?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Setting up a server on Ubuntu Server 15.04 (terminal onl

Post by planetmaker »

When there is no reply yet, please, amend and edit your last posting instead of double and tripple posting. Double posting is forbidden in this forum.
EDIT: you can use an indication like this that you changed the posting after the intial submission to the forum. :)
nordemoniac wrote:I've done the following:

Code: Select all

./configure --enable-dedicated
make --jobs=9
It's now finished, what do I do next?

"<code>make install" what is "code" here?

Also, I guess I still have to manually copy zBase or similar to get 32bpp?
The actual graphics don't matter for a server, thus installing zBase only uses 200MByte where OpenGFX would use 8MByte for the same effect; it's the client who decides which base set s/he wants to use, not the server. Simply install it once using

Code: Select all

apt-get install openttd-data
(or however that package is called on ubuntu)



As to your installation of OpenTTD itself:

After compilation your binary will reside in

Code: Select all

./bin/openttd
relative to the svn repository. You can use

Code: Select all

sudo make install
if you really want to install it. Personally I simply use a separate local dir for each server. It has the advantage that I can easily run a different OpenTTD version for different servers.

From the main dir of the repository:

Code: Select all

mkdir -p ~/server1
make bundle
cp -rp bundle/* ~/server1
Afterwards you can start the server:

Code: Select all

cd ~/server1
./openttd -D -f
or when called inside a screen you can skip forking into background and use the session for quick rcon access
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: Eddi, Google [Bot] and 40 guests