How to Setup a Linux Dedicated Server
Setting up your own dedicated server can be a challenging but rewarding experience, and Linux has become the operating system of choice for server configurations. You may be setting up a web page for your home business and trying to save money on hosting fees, you may want a family page to show to friends or family, or you just want to take a hands-on approach to learning about how the Internet really works.
Instructions
-
-
1
Obtain a static IP or dynamic DNS service. An IP address is a number that is used to contact a computer on the Internet. Every computer connected to the Internet at a given time has an IP address. Most residential Internet connections assign dynamic IP addresses to the computers on their network, which can change over time. However, if you want to set up a home server, this will not do: you will want to advertise your address to other people, and you don't want to have to tell them a new address every couple of days. There are two solutions to this problem: the first, and most common, is to contact your Internet Service Provider about obtaining a static IP, an IP address that is guaranteed not to change. Most service providers will offer this in exchange for a monthly fee. The other is obtain a dynamic DNS service, which will communicate with your server to ensure that it always has a current copy of your IP address on file. This article will assume that you will obtain a static IP.
-
2
Register a domain name. Unless you want to require your server's clients to remember a numerical address like "209.85.225.103", you'll want a domain name, an easy to remember word that will be associated with your IP address on the Internet. For example, "209.85.225.103" is associated with the domain name "google.com". You can do this through a variety of Registrar services on the net, and you'll want to shop around for the best deal for your circumstances.
-
-
3
Choose and download a Linux distribution. There are literally hundreds of Linux distributions with names like Ubuntu, Gentoo and Red Hat. Each distribution has subtle features that distinguish it from the others. Ubuntu emphasizes ease of use and its friendly community of users. Gentoo emphasizes customization. Red Hat emphasizes its corporate support model. This tutorial will use Ubuntu, but all Linux distributions will be fundamentally the same. Download a copy of Ubunutu's server edition CD and burn it to a disc.
-
4
Install your chosen flavor of Linux. For Ubuntu, this is as simple as putting the disc into your computer and following the on-screen dialogues, but for distributions like Red Hat and Gentoo, this will be substantially more involved.
-
5
Install the server software. What software you use will vary depending on what type of server you wish to create, but most likely you want a web server. And if you want a web server, the industry standard Apache is your best choice. Install Apache by running the following command in your Linux terminal:
sudo apt-get install apache2The command may change if you chose another Linux distribution. For example, if you chose Gentoo, the command will be: sudo emerge apache
Once the install is finished, you should be able to view the default Apache homepage by viewing http://localhost in a web browser. If you have registered your domain name, you can also go directly to that. In the Linux file system, your webpage will be in the following directory: /var/www/
-
6
Set up the firewall. Your server will need a firewall service. Under Ubuntu's Linux terminal, type the following to enable your firewall: sudo ufw enable
By default, the firewall will block all traffic, including traffic to your web page. You'll need to open your web page's port with the following command:
sudo ufw allow 80
-
1
Tips & Warnings
Some routers have their own firewalls. Ensure that your router is configured to allow traffic on the port required by your server software. For example, a web server will require port 80 to be open.
Dynamic DNS is a tempting alternative to paying the extra money for a static IP. However, it is less reliable.
Some Internet Service Providers do not allow servers to exist on their residential service plans. Contact your ISP to see if it allows home servers.