File Under: Backend

Set Up a Home Server

Setting up a home server running an open-source operating system is a popular and useful activity. Useful in what ways, you may ask. You could use it to run a website (I use a home server to power my world travel website, luxagraf.net), collect and send e-mail messages, store your OpenID credentials or serve your music around the home.

As you can guess, we have a great many tutorials on Webmonkey for getting the most out of that machine in your closet. But here are some guidelines for the hardware side of it.


.

Contents

  1. Introduction
  2. Before You Start – Alternatives
  3. What you’ll need
  4. The computer
    1. Repurposing a used computer
  5. Architecture
  6. Memory
  7. Storage
  8. Cooling
  9. Network
  10. Buying a server
  11. The Connection
  12. The Router
  13. The Monitor and Keyboard
  14. Power
  15. Everything in Its Place
  16. The Operating System
  17. Suggested reading
  18. Suggested readings

Introduction

Before You Start – Alternatives

Setting up a home server can be a lot of fun and a great learning experience. But, depending on what you want to use it for and how good your connection to the Internet is, a home server may not be the best alternative. If your aim is serving web pages reliably or otherwise delivering information outside your home to friends or customers, it makes more sense to put the server into “The Cloud” – in other words, in a commercial data center. This saves nyou the worry and hassle of keeping it running or dealing with interruptions to your home’s power, cable or DSL service. “Cloud Computing,” or renting just as much of a server as you need on an hourly or monthly basis, is becoming quite popular for web companies or growing businesses, but the rates are inexpensive enough that you should consider it as an alternative to a home server. There are many cloud computing companies, ranging from Amazon Web Services which requires that you learn their command line interface to initiate a new server, to ENKI which offers personal support for getting you up and running. This isn’t the place to go into detail, but you can learn more by Googling “Cloud Computing.”

What you’ll need

To build your own server, you need just a few components, some or all of which you may well have already:

  • A computer
  • A broadband network connection
  • A network router, with Ethernet (CAT5) cable
  • A monitor and keyboard (just for the first few steps)
  • A CD/DVD drive/burner will be handy if you plan to use the server for media.

The computer

A server doesn’t have to be particularly powerful. eBay runs on mega-thousand-dollar Sun computers, and Google uses thousands of machines to power its search. But for personal use, a server needs considerably less horsepower than your average desktop computer. While other computers busy themselves with complex tasks like despeckling photographs and calculating missile trajectories, your home server has a much simpler task: receiving requests for data and then sending that data as requested. Your server won’t use much processing power, especially without a graphical interface to worry about. A machine with 64MB of RAM and a 300MHz processor can make a perfectly good server; with slightly more robust specs, it can handle almost anything you’ll throw at it.

An old machine can be turned into a server with minimal effort. You may already have a perfect machine for the job sitting in your attic. Or a relative or a friend might want to get rid of her older desktop; or you may well be able to pick up a suitable model cheap or free from a swap meet, a classified ad, or online equivalents like freecycle.org and craigslist.org. Alternately, you can buy a new machine to use as your server. Each approach has its advantages.

The reasons you might not want to use an old machine include:

Old hardware can be unreliable. Sometimes replacing bad RAM or putting in a new heatsink will fix the problem, but sometimes a computer just crashes every few hours, regardless of what operating system is installed. Time to donate or recycle it.

Space is an issue. If the old machine is in a big tower case and you are in a small apartment, you might want to get it a new case — or you might want to buy a new server that’s one tenth the size.

You want it quiet. Computers get hot, so fans are installed to keep them cool. Fans are loud, even the ones marketed as “whisper-quiet.” You might not notice that so much in an office setting, but when a server is left running 24 hours a day (as they should be), it becomes rather irritating to live with in close quarters. If you’re going to be sharing a living space with your server, you may want to invest in a fanless machine.

You don’t have an old computer on hand, and you live in a place where finding cheap, used hardware is difficult or expensive.

If any of the above apply, you can skip to the section titled Buying a server.


Repurposing a used computer

If you go the way of turning an older machine into a server, congratulations. If it’s a particularly geriatric model, you might have a little work ahead of you to get it ready for its new assignment. Upgrading a couple of its parts will make it a powerhouse for years to come. You can find plenty of support, if you have questions about what connector goes where, on hardware-nerd sites like tomshardware.com and arstechnica.com. Or, if messing with wires and chips is too daunting, your local computer shop should do it for a minimal fee.

Architecture

What sort of computer you use — i386, PowerPC, Gameboy — matters surprisingly little. Linux and BSD, the preferable server operating systems, run on just about any architecture you care to install them on. The official list of chips on which Debian can run includes Intel x86, Motorola 680xx, Sun Sparc, Alpha, PowerPC, ARM, MIPS, HP PA, Intel 64-bit, and S/390 processors, with more in the testing phase. That covers the vast majority of consumer computers ever made. Buy a notebook (the paper kind) and label it My Server. Write down all the model numbers and details of the hardware you set up.

Memory

RAM is cheap these days, and more is generally better.


Storage

The hard drive is the heart of the server. If everything else dies, you can pull out the hard drive and put it in another (comparable) machine, and pick up right where you left off. Depending on how many slots your computer is built with, you might want to have one hard drive or a few. Bigger is better.

Hard drives continuously drop in price. Start fresh with a new one. If you’re disposing of an old drive and replacing it with a new one, don’t forget to securely delete any private information before you put it in the trash.

The innards of a hard drive spin around thousands of times per second, so it’s very likely that the hard drive will be the first component of your server to fail, though you can generally count on a new drive for a few good years at least. Proper backup procedures are crucial; for now, if you have room in your server and in your budget, you may want to slot in a second or even third hard drive. Keeping secondary copies of data in another place — even if that’s just a second drive right next to the first one — is the way to safeguard your data against hard drive failure.


Cooling

Since the server’s going to be running all the time, you need to make sure it doesn’t overheat. The machine you have might already be fine in that department, or it might not. If it crashes unexpectedly, or exhibits weird, unpredictable behavior, it may be getting too hot. There’s software you can install to monitor the machine’s temperature as it runs, and even set it up to e-mail you automatically if it’s creeping into the danger zone on a hot day.

You can splurge on a wide variety of methods to keep the CPU and power supply cool, involving air, water, liquid nitrogen, and so on. You also may want to look into underclocking your processor. That makes it run slower (which is fine for a server, remember) but also cooler. If you’re handy with solder, there are dozens of underclocking tutorials online for your particular chip type. Generally, though, setting up good airflow through the box is sufficient for most home servers, with some quality fans sensibly arranged to pull air in at one end of the case, direct it over the hot components, and push it out the other. Larger fans tend to be quieter than smaller models, all else being equal. If you’re living with the server, you will want quiet fans, the quietest you can get.


Network

The server’s also going to need an Ethernet card (also known as a network interface card, or NIC), and one that works with your chosen operating system. You can’t go wrong with most cards (especially older models), but you’ll definitely want to check the model number on linux-drivers.org or elsewhere on the web before buying a new one. Big brands like 3Com and D-Link are generally a good, reliable bet.

Buying a server

Alternately, you could buy a server. There are plenty of up-to-date guides on the web. You can use a standard desktop computers, which contain powerful, expensive, and hot Intel and AMD-brand chips. That’s fine, but brands like Shuttle or Biostar, built on the mini-ITX or nano-ITX specification are smaller, cheaper, and cooler. These can fit in cigar boxes and run silently without fans, on low power. Complete systems using these chipsets can be bought from a variety of specialty retailers, including idotpc.com and mini-itx.com. You shouldn’t have to spend more than a couple of hundred dollars for a serviceable system.

The Connection

Apart from that, any sort of connection will do. Super speed is not important (unless you’re planning to stream videos to dozens of users). If you have a connection already (probably you do) you can continue to use it as normal. Just keep your server connected to the router. A static IP is not necessary, nor is a business-class connection.

Your choice of providers will vary depending on your area. If you have a choice, pick a provider that offers good, reliable speeds and makes its customers happy. Ask around, or search the web for the phrase “[provider] sucks” if you want to hear the worst. Some providers have very restrictive policies and prefer their users not to do things like build servers; others, like the excellent sonic.net, are thrilled to have adventurous users. The choice between cable, DSL, fiber, satellite, and so on is less important; after trying an assortment, you won’t notice a significant difference unless you’re streaming video or high-quality audio.

The Router

Get a reliable router. It can be wireless, if you want to connect other computers to it wirelessly, but plan on using a real old-fashioned cable between it and the server. A router is a pretty standard commodity these days; some may have extra features, but it’s the basics, not the extras, that count. Again, looking at what other shoppers have liked, on a site like newegg.com, can be an excellent guideline.

The Monitor and Keyboard

If you have an old spare desktop, you may have a spare monitor and keyboard to go with it. Or you can use your current computer, if you’re not using a laptop, and willing to switch back and forth while you get things set up. You’ll only need these until you get your server up and running. A monitor and keyboard are very handy to have tucked away somewhere for future debugging and upgrading of the server, though.

Power

If you live in an area prone to power surges, rolling brownouts, or the like, or even if you don’t, some sort of intermediary between your machine and the AC socket is a good idea. This can be as simple as a $10 surge suppressor (not just an extension cord) or an elaborate power conditioner with hours of battery backup.

Everything in Its Place

After your box is upgraded, you’ll need to find a home for it. You’ll want to keep a few practical considerations in mind.

  • Don’t place it next to a heater, or in a sunbeam. Don’t place it by an open window. Dust is a server’s enemy too, so don’t keep it under the bed.
  • Don’t let people trip over the cords, or let pets chew on them.
  • With proper attention to cooling, your server should be quite quiet, but some people are sensitive to even the faintest hum. Especially if your server is not the noiseless variety, you might want it in a less-trafficked area. The website Silent PC Review has advice and hardware recommendations for avoiding the noise.
  • Putting it in a little closet is good, as long as there’s enough airflow that the thing won’t overheat. Make sure to place it on a hard surface so as not to block the air intakes, leave a few inches of space around it on all sides, and don’t pile stuff on top of it.
  • Theft is another concern: keeping a shiny server right by the front door might not be the best idea.
  • A lot of your placement concerns may be dictated by your internet connection, since the server needs to be within a cord’s reach of that. If you use a wireless router to share the connection with the rest of the house, that ought to be centrally located, and the server plugged directly into it, wherever it is.
  • It’ll also need to be plugged into an electric outlet.
  • If you’re going to be doing stuff like ripping CDs with the server, you’ll want it conveniently placed for feeding discs in.


The Operating System

There are many, many options for an open source operating system. You can install Fedora, Ubuntu, FreeBSD, Gentoo, and the list goes on and on.

Another option is to install the open source home server from Amahi. This will do alot of the ‘heavy lifting’ to get you up and running, including installing and configuring apache, MySQL, a Ruby on Rails deployment environment, file sharing, a VPN and a range of share web applications. You’ll find alot of useful information on this topic at the Amahi website.

Suggested reading

What can you do with that server? Here are some projects: