Many server packages (such as Apache2, MySQL, PHP, etc.) can be installed individually, on either a Desktop edition or a Server edition (using the tasksel command described below). It is not necessary in general, therefore, to install Ubuntu Server if you only wish to use an occasional server package on a Desktop edition. Most of the instructions for individual server packages will work on the Server edition, on the Desktop edition, or on a Server edition that has had an Ubuntu or Kubuntu desktop installed on it.
Nevertheless, the Server edition is optimised for speed and ease of monitoring and maintenance when implemented in large networks and is therefore recommended. (For complete information see the Ubuntu Server Guide.) It is always possible to add an Ubuntu (Gnome) or Kubuntu (KDE) GUI desktop to an Ubuntu Server at any time.
- Download the latest Ubuntu Server ISO image from Ubuntu downloads.
- See this guide for burning the ISO image to a CD.
- Use the CD for installation of the server.
(If you are attempting to create a dual-boot or multi-boot configuration with multiple operating systems on your computer, then see these tips.)
(Tip: During installation of the server, an initial user / password is created. Many servers are intended to run unattended with little subsequent intervention and it can be easy to forget the original user / password pair that is created at installation. I suggest writing this information down and taping it to the inside of the computer case cover for later reference. (Lock the computer case if you desire extra security.))
There are many server packages that are available to be installed as a one-step process during the Server edition installation process from the LiveCD, or at any time (on most editions) using the tasksel command. For a list of server packages that can be installed using the tasksel command:
sudo apt-get install tasksel sudo tasksel --list-tasks
- or using a GUI list:
Ultimate Server Walkthrough
- Using instructions from Ubuntuguide, an ultimate server can be created with two wikis (MediaWiki), two Drupal websites, a Moodle online learning website, a BigBlueButton teleconferencing server, an Ubuntu desktop, and dynamic DNS access from the web. All components can be expanded and/or additional servers added.
- To run multiple servers on multiple computers on a LAN using only a single IP address and router, see Reverse proxy Servers and Load Balancers.
Add a desktop to an Ubuntu Server
Packages that require server capabilities (such as Drupal with Apache, etc.) are often happier when a Server edition is installed as the base OS. However, adding a desktop can make the administration and maintenance of many packages easier for many users (albeit with a cost of reduced server speed). Add an Ubuntu (Unity or Gnome) or Kubuntu (KDE) desktop to a server using:
sudo apt-get install ubuntu-desktop
sudo apt-get install kubuntu-desktop
LAMP server installation
During server installation, you will have the option of installing a LAMP (Linux, Apache, MySQL, PHP) server stack. Many (but not all) open source servers use this integrated server stack. Drupal, for example, needs to have a LAMP server installed. If you intend to install a groupware server, however, make sure it is compatible with a LAMP server stack before choosing this option. Many groupware servers will install LAMP (or their own variation) automatically, so you do not need to install the LAMP stack. Others will install and use postgreSQL instead of MySQL, so you would not need to install a LAMP server.
Apache2 + MySQL + PHP
This is the preferred method:
sudo apt-get install tasksel sudo tasksel install lamp-server
(Tip: During installation of the LAMP server, an initial MySQL "root" user password is created. This information will sometimes be needed when installing other server packages that use MySQL. I suggest writing the MySQL password down and taping it to the inside of the computer case cover for later reference. (Lock the computer case if you desire extra security.))
During server installation, you can choose other servers to install, as well. These include a Mail server (Postfix with Dovecot), a DNS server (bind9), the OpenSSH server, a print server, a Tomcat Java web server, a Samba file server (for use with Windows networks), and a virtual machine host (Xen). Again, if you are using a groupware solution, you should be careful about installing these services, as they may conflict with similar (but competing) servers which the groupware solution will install by default.
eBox (server and network manager)
eBox is a web-browser based server management platform that is useful in managing multiple servers and networking functions in a small to medium business. It is modular so that as the network grows and more networking functions or servers (such as the ones listed below) are added, eBox can manage those, as well. Install:
sudo apt-get install ebox
OpenSSH allows encrypted communications through a designated secure port. See setting up an SSH server.
- See the section on VPN servers and the section on VPN clients.
- See OpenVPN help at the Ubuntu Server Guide.
- Also see these tips for the OpenVPN server.
- See this section.
There are two methods for setting up a mail server.
- The dovecot-postfix package install the components and configuration files to use the Maildir (mail spooling) folder system by default. See Dovecot-Postfix Mail server.
- The mail-server task installs the components and configuration files to use the mbox (mail spooling) system by default. This can be installed:
sudo apt-get install tasksel sudo tasksel install mail-server
Bind9 (DNS server)
BIND DNS servers are the most commonly used on the Internet. Bind9 is the current edition. See the usage instruction here. Also see the official Ubuntu documentation for more configuration information. It can be installed using the tasksel option during installation of the Ubuntu server from the LiveCD, or at any time using:
sudo tasksel install dns-server
Apache Tomcat (Java server)
It is not part of the Apache2 web server. See the official Ubuntu documentation for more configuration information. It can be installed using the tasksel option during installation of the Ubuntu server from the LiveCD, or at any time using:
sudo tasksel install tomcat-server
Xen virtual machine host
Xen is a free open source virtualization platform that allows the host to run "guest" operating systems simultaneously (see here for more info). Xen implementation in the (K)ubuntu server is based on integration with KVM, the kernel-based virtualization platform in Linux. KVM integrates with QEMU components, which have been merged with Xen.
Note: KVM requires a 64-bit processor with a virtualization extension, i.e. an Intel VT or AMD-V CPU, therefore this package currently is successful only with the 64-bit Ubuntu server installation and on those CPUs.
It can be installed using the tasksel option during installation of the Ubuntu server from the LiveCD, or at any time using:
sudo tasksel install virt-host
Ubuntu uses the CUPS print server, which is integrated into the desktop. Installing a print server in Ubuntu Server is necessary only if you do not intend to use a desktop (i.e. you intend a "headless" server). It can be installed using the tasksel option during installation of the Ubuntu server from the LiveCD, or at any time using:
sudo tasksel install print-server
OpenLDAP is a community-based LDAP server that allows directory querying over TCP/IP, generally for organizations arranged by domain. Ubuntu uses the slapd daemon for the OpenLDAP server. See the official Ubuntu documentation for more information about installation and setup.
Squid is a widely-used proxy web server and web cache daemon that is useful for corporate or other large LANs that wish to accelerate and/or control traffic through the LAN. For initial configuration information, see the official Ubuntu documentation. Install:
sudo apt-get install squid
Privoxy is a non-caching web proxy with advanced filtering capabilities for enhancing privacy, modifying web page data and HTTP headers, controlling access, and removing ads and other obnoxious Internet junk. It is easier to configure and more useful for individual users. Install:
sudo apt-get install privoxy
Reverse proxy Servers and Load Balancers
A reverse proxy server allows incoming web traffic on a LAN to be directed to multiple computers (each running one or more servers) on the LAN. When redundant instances of a server exist on a LAN, a Load Balancer allows traffic to be directed to the most available instance.
Pound (Reverse proxy and load balancer)
sudo apt-get install pound
Apache Reverse proxy
There are several free and/or GPL-licensed control panel utilities for managing multiple servers on a single physical server or cluster of servers running Debian/Ubuntu-based servers. Here is a brief overview.
- Webmin is the most widely used web browser-based free open source web hosting control panel for Linux.
- GNUPanel is a free GPL-licensed web hosting control panel system that is compatible with Debian/Ubuntu OS using PHP.
- Web-cp.net is a free GPL-licensed web hosting control panel system that is compatible with Debian/Ubuntu OS using PHP.
See this Linux Planet article recommending open source Linux media servers, including MediaTomb (also see Ubuntu Community help -- MediaTomb), Jinzora (also see here), Wizd, Firefly (now forked as forked-daapd), and MythTV.
Network Attached Servers
- Here are some user-contributed suggestions regarding commercially available NAS/RAID devices.
FreeNAS allows a PC with several hard drives to function as a self-contained network attached storage RAID device. It is a very small, fast system, so that an older PCs could function quite well as an NAS.
Setup RAID in Ubuntu/Kubuntu
See this thread for a discussion how to set up RAID on an Ubuntu/Kubuntu server.
There are several free enterprise-strength databases that can be used in (K)Ubuntu Linux.
PostgreSQL is a free standards-compliant enterprise-strength open-source database, initially developed at UC Berkeley. See the PostgreSQL Server documentation for server configuration information. Install using the dummy task:
sudo apt-get install tasksel sudo tasksel postgresql-server
- or install directly:
sudo apt-get install postgresql-8.4
sudo apt-get install postgresql
MySQL is one of the most widely-used relational databases, and has been licensed under the GPLv2. It has now been bought by Oracle as part of the purchase of Sun. It has long been integrated into co-ordinated server platforms using the LAMP stack, but it can also be installed separately.
sudo apt-get install mysql-server
Since the purchase of MySQL by Oracle, an effort to maintain a true community-driven replacement for MySQL has emerged in the form of MariaDB, whose lead developer is the founder of the original MySQL. It is touted as a drop-in replacement for MySQL on a verion-by-version basis. (See this comparison.) Installation is from the MariaDB repositories. For example, to install MariaDB version 10.0:
sudo apt-get install software-properties-common sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu saucy main' sudo apt-get update sudo apt-get install mariadb-server
- Note: Key servers often use port 11371. Make sure your firewall allows port 11371 to be open.
- This page includes these steps to add required dependencies:
sudo apt-get install libmariadbclient-dev libmariadbclient18 libmariadbd-dev libmysqlclient18 mariadb-client sudo apt-get install mariadb-client-5.5 mariadb-client-core-5.5 mariadb-common mariadb-server mariadb-server-5.5 sudo apt-get install mariadb-server-core-5.5 mariadb-test mariadb-test-5.5 mysql-common
sudo /etc/init.d/mysql start
- This page recommends immediately securing the database: "Secure MariaDB by the mysql_secure_installation command and configure:"
Remove anonymous users? [Y/n] Y Disallow root login remotely? [Y/n] Y Remove test database and access to it? [Y/n] Y Reload privilege tables now? [Y/n] Y