Howto: Run a server in Linux

Froggie

Rookie
Joined
May 28, 2009
Messages
47
**This guide is written for ubuntu and debian. Commands in other distros are not the same**

I saw the thread for how to run a server in windows, but many people use linux, especially if renting a dedi-box. Although to some linux might seem complicated, it's suprisingly easy to use and takes almost no time to get to grips with at all. Also, it tends to be more stable, and won't automatically re-boot to do updates :) This results in minimal downtime.

If you are using a home computer, skip to step 2.


1) So you have a linux server, but it's in a remote location, so the first thing you need is to download putty. It's an SSH client that means you can enter commands as if you were at the computer. So go and download it, and enter in your IP, username and password to login.

Once you are logged in, type the following commands:
Code:
sudo apt-get install gdm
sudo apt-get install gnome
sudo apt-get install vncserver
Each of those will take quite some time to complete, so go watch some TV and come back when it's done.

What we have just done is installed a graphical interface to the machine, rather than a command prompt only screen, which is much harder to use. VNC is like remote desktop but for linux, so you can use it graphically as if you were at the machine.

Now you must start the vncserver, so you can actually view it, simply type
Code:
vncserver -geometry 1024?768 -depth 24

It will ask for a password, so give one (you'll have you type it twice) and then it will print some information in your screen, which amongst other things will containt:
Code:
 ...desktop is xxxx:1

The number after the colon is the screen number, which i'll come to in a minute.

Download TightVNC Viewer and run it. In the "VNC server" box type the ip of your machine, followed by a colon then the screen number, for example
Code:
17.34.58.12:2

It will ask for a password, so enter your password and if all went successfully you will be a looking at a desktop, as if you were at the computer!


2) Install wine.
Steam and the server programs are windows programs, but we are running linux. Fortunately there is a nice little app called "wine", which runs your windows programs in linux, so first of all we need to download and install it. Load up a terminal and type:
Code:
sudo apt-get install wine

3) Download tahoma.ttf to the windows\fonts folder
Steam uses tahoma, so won't run if you don't have it. You can find it with google (I won't link for obvious reasons) and download it. Finally, Browse to your wine C:\ drive and then to the fonts directory. (home/username/.wine/drive_C/windows/fonts) and copy Tahoma.ttf

4) Download and install steam
Load up firefox (it comes with gnome so should be on your system, if it's not, 'sudo apt-get install firefox' in the terminal will install it) and go to the steam website. Download the .msi to your desktop.
Load the terminal, and type
Code:
cd
cd Desktop
wine msiexec /i SteamInstall.msi

Follow the instructions and login, hopefully it's now as if you were running steam on a windows computer!

5) Install the server and finish up.
Lastly we need to install the server, located in tools. Let it download, and install it as usual.
There will also be incoming connections to your pc, so make sure you open the ports in your router if you have one.

All done! If there's anything you didn't understand let me know and I'll go through it in more detail.

Thanks.
 
Last edited:
But that is not all!

Now you have steam running, why not install tf2? Counter-strike? They will all work and you won't even notice you're not running windows.

Although it's slightly different, a similar process is required to install the following, so if you want a guide to these I am more than happy to make one:
-The adobe suite (Photoshop, dreamweaver, illustrator, flash, etc.)
-MS Office 2007
-Many other games

You can even have windows run inside linux, so if you're thinking about making the switch, please do! On my work laptop I dual-boot ubuntu and vista, and it's fantastic. I really recommend that you try a form of linux.
 
Last edited:
A great post, but keep in mind there is a much more simple way to run a linux server, rather then use wine and steam, just install HLDS linux version from valve's download page and it will allow you to run a server without needing to login to steam.
 
This was designed for people that were more used to windows and wanted a graphical option, and this also allows you to play games, but i'll give the hlds tool a look at some point, and maybe update the guide.

Thanks.

==EDIT==
I've just realised this is in the wrong forum. If someone could move this to Tech help it would be appreciated. Thanks!
 
I would not recommend forwarding your vnc or ssh ports through the router to the linux box for offsite use without a good understanding of linux security. Running them behind a router is a must.

HLDS is the linux native server app and installing it is very easy as well in ubuntu.
I would imagine that running hlds servers would require less computing power than running them through wine, but that could be that my ubuntu machine is only a 3200 Athlon and runs wine apps very slowly.

I've successfully run tf2 and l4d servers via. hlds. I don't think there is currently a native hlds server release for killing floor unfortunately. The hardest part is probably setting up your conf file with all of your server preferences, but there is a ton about that online. I recommend running your hlds server on a "screen" in a terminal window so that it can be detached with "control+alt+d" and later resumed via. ssh session with "screen -r".
 
I would imagine that running hlds servers would require less computing power than running them through wine, but that could be that my ubuntu machine is only a 3200 Athlon and runs wine apps very slowly.

When was the last time you tried? The very first builds of wine were awfully slow and gave errors for just about everything. With a couple of extra optimisation commands you can make it run just as smoothly as windows; playing a game would take at worst 10% off your fps, but with a server you would barely notice at all any performance issues.

I'm not saying it's perfect, but it's a solution for people running linux who are not used to the command line.
 
one thing you might want to add, just a thought, incase said server isn't running debian...

like your COD 4 servers... when I originally started working on them well the commands aren't the same, Red Hat, CentOS and Fedora Core do not use the same commands to install things.

I was used to using the apt-get and whatnot... but they use "yum" you might want to include the alternative commands incase they don't get to use debian based distros.

just a thought since we are talking about less linux savvy users here.
 
I'm not particularly knowledgable about anything non-debian based (and don't hold anything I say about debian to be true either!). At some point i'll try and add alternative commands for different distros.
 
Nice, Alway something over looked just cant find it yet.
Looks like a good layout really.
 

Latest posts

Back
Top