A blog all about Linux and Linux software.
A blog all about Linux and Linux software.

Setting up a Linux Raspberry Pi Web Server

Lots of people think that servers are big and complex computers that cost a lot of money. Today I am going to disprove this theory with a home server run on the $35 raspberry pi. You could try to use the even cheaper $25 model but you gain so much by using the $35 model B+ that i would definatly recomend it over the model A.

What can you do with the pi.

There is an almost infinate list of what you can do with the raspberry pi if you have the time and ability but I will just tell you what my raspberry pi is doing

  1. A web server using apache
  2. A host for my films using NFS
  3. A music host also using NFS
  4. And a host for all my documents

What you will need

  1. A Raspberry pi $35 £21
  2. A micro sd card (vaires in price) Get at least 4GB and prefeably at least class 8. The raspberry pi charity sell a 8gb card with debian already on it. Here

  3. A micro usb charger (Google to make sure it provides enough power to keep the pi constantly running
  4. A usb sd card reader if you don't already have one

How to set it up

  1. Vist this page to set up your pi
  2. Once you know your pi can boot up fine and you have checked the desktop works we need to configure the pi to act as a server.
  3. in rasp-config eiother change the password of the user pi or make a new user with a complex password
  4. If you are using windows download the ssh client putty (or if you have another faviroute use that)
  5. If you are using mac search for how to enable ssh on OSX if it is not already enabled
  6. Linux comes with ssh pre installed so you don't need to do anything

next type ifconfig and see what the interenet address is eg

Now you need to connect to your pi of SSH. For linux and mac you type ssh pi@ and then type in you password when it prompts you


On windows you have to launch putty type in the hostname box. Press conect type in your username and password and then you should be able to accsess your pi on your internal network

Next you have to remove some programs from the pi you do this with

<sudo apt-get remove>

Now type

<sudo apt-get remove mathematica lxde>

This will remove the package mathematica and the desktop to save space and time when updating


Now run <sudo apt-get update> and <sudo apt-get dist-upgrade> to make sure you are using the latest version

Now you need to install a package to run your web server

<sudo apt-get install apache2>

This will give you a basic web page

To check you web site works you need to type the addressfor your raspberry pi. You should get a message "It works" in your browser. Now I would give ownership of the www folder to your user with <sudo chown -R user /var/www>. All you do now is copy all your web files across and you should have a complete web server for less than £50 or roughly $80


If you want to do more you could read lifehackers guide to installing media wiki or owncloud.


Read part 2 to find out how to install NFS that stands for network file system.

Part 2 here

Share This Story

Get our newsletter