Simple Ubuntu server setup

An Ubuntu server installation can vary widely depending on what you want to accomplish. Our goal is a base installation just enough for the server to boot a multi user environment and allow for remote login via ssh.

On versions and hardware requirements

Ubuntu 9.04 is the current version, at the time of this writing. However, the process for installing Ubuntu server does not change much (if at all) across server versions. This guide could also be useful for the past versions such as 8.10 and 8.04

It’s best to read the hardware requirements from the website of Ubuntu. just to be sure you have the appropriate hardware.

Preparation before the installation

You can obtain the installer in a variety of ways. By going to the website of Ubuntu and request for a free CD, but there is a wait of around 6 to 10 weeks; alternatively, you can download the installer — using the same link.

If you choose to download, you will need the following:

1. A CD writer
2. Software to burn ISO images to CD (You can use ImgBurn in Windows, or whatever cd burning software you are familiar with)
3. A blank CD

ImgBurn is straightforward to use. After the install, just right-click the Ubuntu installer file, then choose the Burn option.

Step by step installation

1. Insert the installer into a DVD or CD rom drive, choose “Install to hard disk” press enter

2. Choose your language (I chose English)

3. Set your location ( your country )

4. Choose a country, territory or area

5. Choose your keyboard layout, I chose US english layout. You can also follow the wizard, and let the installer figure it out.

If you allowed the installer to figure out the layout for you, at the end of key typing exercises, you will be asked to continue, just press “Continue”

6. The installer will try to acquire an IP address from a DHCP server (that’s why it’s a good idea to setup your router before this step) — you can setup it up manually if you like. But we will do that later, so if the installer succeeded in acquiring an IP address, just use that for now.

7. You will be asked to type the hostname of your server ; You can give any name to your server — it’s your server after all.

8. The next screen will be the partition dialog. Just choose “Guided, use entire disk”

9. Choose your disk, if you’ve only got one, that’s not a problem, just select it, then press enter. You will be asked to confirm your choices. Select “Yes” to write the changes to the disk.

10. Configure the system clock, UTC is usually a safe choice.

11. Create the users for this server. You can enter just one for now, you can add users later on. After you have entered the username and password, the installation will continue with the base installation.

12. You’ll be asked to install additional software like Web server and DNS server, don’t select anything. We will install them later using the apt-get facility. Just continue without selecting additional software.

13. After the GRUB installation, the system will reboot for the first time. Remove the installer disc when you are asked to.

Some more things you need to do

Most servers are headless (no keyboard, no monitor) and tucked neatly away from the workstations. You will need a way to communicate — to login remotely. We will install an SSH server to serve that purpose.

$ sudo apt-get install ssh sysv-rc-conf

“Sudo” is a way in Linux to perform commands using a (temporary) elevated privilege, if you are asked for the password, just type your own password — it’s not asking you for the super user (root) password.

I’ve also included sysv-rc-conf as part of the install, so that you will have a way to restart services without having to memorize the syntax of /etc/init.d/./ …. If you want to restart anything, just type “$ sudo sysv-rc-conf”, it’s a full screen, menu driven utility that allows you to start | stop services, by pressing the plus (+) sign, and minus (-) sign, respectively.

You can change the default shell as well (optional), I changed mine to bash — because Ubuntu installs dash by default instead of the more common bash (Bourne Again Shell)

$ sudo rm -f /bin/sh
$ sudo ln -s /bin/bash /bin/sh

Ubuntu really does not want you to use the root user (super user) — that’s the reason you weren’t asked for root password during installation; But there are situations where it will be handy to have a root user; like if something bad happened to the regular users, you will need to be root to fix those. So we will define the password for the root user. Just follow the steps.

$ sudo passwd root

You will be asked to enter the password for the root user — it’s not a password challenge, you are being asked to set the password for the root user for the first time.

Final step is to change the IP address of this server, from dynamic IP to static IP — because it’s a server, it’s better for the IP address to be bit more permanent.

In this setup, I’m assuming that your internet gateway (Your router) is 192.168.1.1 and this Linux server will be 192.168.1.2 — to set the IP address statically, you need to edit the “interfaces” file found in /etc/network.

$ sudo nano /etc/network/interfaces

The interfaces file should look like this


# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.1.2
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1

You need to restart the network software of your server — you could just reboot (the simplest), or you could issue the command

$ sudo /etc/init.d/./networking restart

After the server has rebooted, you might want to check if you can really login remotely to this server — you know, before you remove the monitor and keyboard; and before you tuck it away. You can use Putty (windows client) to login using ssh. If you are using OSX or another Linux machine, you can simply type

$ ssh root@192.168.1.2

You can use the hostname in the above command instead of the IP address; Just enter the password, and then you’re logged in.

Some of the Linux commands you might need

$ sudo halt -p – If you want to shutdown the server
$ sudo reboot – To restart the server
$ sudo sysv-rc-conf – to restart services
$ sudo date –set=+HH:MM:SS – where (Hour : Minutes : Seconds), will set the system date and time.
$ sudo adduser UserName – Will add a new user
$ sudo userdel UserName – Will delete a user
$ sudo apt-get update – To keep your server updated
$ df -h – to see how much disk space is still left
$ cat /proc/meminfo – to see RAM information
$ top – to check which process is eating up your server the most (press ‘q’ to exit top)
$ info Any-Linux-command-here – probably the most important command you need to learn, this is how to get help in Linux (press ‘q’ to exit info)
$ man Any-Linux-command-here same as info, but a bit older

Post navigation
(previous post)
(next post)
| | | | .

{0 Comments .. you can add one }

Leave a comment