Hi there,
This is my first Instructable so all criticisms and comments are welcome.
This will show you how to set up a simple wired web server on your Raspberry Pi, with PHP and MySql.

The Raspberry Pi is a good choice for a webserver that will not recieve too much traffic, such as a testing server, or small intranet, as it doesn;t get too hot (so is nice and quiet), and only uses around 5 Watts of power (costing £3.50 a year where I am if it's running 24/7)

In the future I might add how to set up a wireless server.

If you have any problems, post them in the comments, or PM me - I'm happy to help.

Step 1: You will Need

To create a simple web server, you will need:

1. A power supply (Micro USB)
2. A network cable
3. A HDMI cable (or Component cable) as well as a screen and USB keyboard
3. A Raspberry Pi
4. An SD card (2GB or more)
5. An SD card reader for your computer
6. Win32DiskImager (For Windows) or dd (for Unix)
7. The Raspberry Pi Debian Image
8. PuTTY (For Windows) or any other SSH client
9. Around an hour of free time

You can download the software from the following locations: (for Win32DiskImager) (Debian Image) (for PuTTY)

Step 2: Format SD Card

Firstly, you need to install the Debian image onto an SD card (2GB or more).
(The image can be downloaded from

You can do this using the Win23DiskImager tool for Windows (downloaded from

Insert your SD card.
Once you have downloaded the above, Extract the Debian image, and the Imaging tool, then run Win32DiskImager.
Ignore the error that you will see.
Select the Image file (debian6-19-04-2012) and your SD card, then click "Write", it will ask you to confirm, click "Yes". Then enjoy a break, as it usually takes a couple of minutes to write.

Once the write process has finished, you can remove the SD card, then the fun begins.
Remove these adsRemove these ads by Signing Up
1-40 of 202Next »
dale3h2 years ago
Just wanted to share my experience with this Instructable. Everything went smoothly until it was time to connect to MySQL from a remote machine on the same network. So here's how to fix that:

1. Grant access to your remote machine using: GRANT ALL ON *.* TO 'root'@'192.168.1.%' IDENTIFIED BY 'your_password_here'; (I used 192.168.1.% so that any computer on my network can connect to it)
2. Go into the my.cnf file (sudo nano /etc/mysql/my.cnf) file and look for "bind-address" and comment this out (put a # in front of the line)
3. Reload MySQL config (service mysql reload)
4. Restart MySQL server (service mysql restart)

Hope this helps, and thank you for the great Instructable :)
diy_bloke dale3h2 months ago

is the "GRANT ALL ON *.* TO 'root'@'192.168.1.%' IDENTIFIED BY 'your_password_here';"
a command you type into the terminal? or does it go into some config file?
btw, I can advise anybody using a remote linux server (like the Raspberry) to install 'webmin' as well

drcurzon (author)  dale3h2 years ago
Hi there,
Thanks for posting this to help others :)
GalenA119 hours ago

How to gain access to root again

do NOT remove the # in front of the pi password

login as pi

type sudo -i (gives root w/o passwd)

type passwd


verify password


oululife5 days ago

Good writeup.
I did much the same, but used lighttpd as the server. Also couple of recommendations:

If my host machine is running Linux, not Windows, try PACmanager as an alternative to putty. Bit more friendly.
At some point, do a "sudo rpi-update" to make sure your firmware's gets extra goodies to the camera, etc. Needs a reboot afterwards.
Load Filezilla on the host machine! Saves a lot of messing about!
If you want to put the machine on the web, checkout (I might write an 'instructable' for this, it's fairly easy, but...
Anyway, has been running this, only interrupted when we had to decorate, for over a year without any downtime.

New to using the Pi. When I enter the command "ifdown eth0" I receive an error saying interface eth0 no configured.

Is this also causing me to get the Network Error:Connection refused?

Hello there,

eth0 connection is a connection via Ethernet cable, if you are using a WiFi dongle, type in wlan0 instead.

I recommend typing in "sudo ifdown wlan0 && sudo ifup wlan0" instead as it put both command together so you can reconnect if your doing the commands remotely.

New to using the Pi. When I enter the command "ifdown eth0" I receive an error saying interface eth0 no configured.

Is this also causing me to get the Network Error:Connection refused?

mikak21 month ago

I was able to log in as root after restarting the raspberry. Then I removed the # added for user pi. After that user pi was found again.

LeonardoR21 month ago

Typo after closing nano: "service" instead of "servce"

WouterD made it!1 month ago

For installing PHPMyAdmin you should follow this tutorial, much easier and it WORKS. Great tutorial though.


You can use your Banana Pi also as a Webserver / FTP Server:

itsleif11 months ago
I followed the steps, all works fine, but now I cannot log in any more. After restart the pi user login does not work and the new password does not work either. I also tried the root user with both passwords the old and the new, nothing works.

No I cannot log in my pi any more :( I cannot change the password file either because my mac does not mount the linux partition...

how can login again?
MattC1 itsleif1 month ago

remove the # infront of pi:x;1000:1000:Raspberry Pi User,,,:home/pi:/bin/bash

Ok but how to remove ? Because while adding I was connected with SSH. now can't connect with SSH so ... ?

login in to ssh as root

angelo49 itsleif4 months ago

Hey! Same thing happened to me. What did you end up doing??? I'm so stressed! Thank you!

aidenv1 month ago

To log in again using the user pi you need to add that user to the group pi.

ssh to pi with user root

type sudo useradd -g pi pi

type passwd pi

type new UNIX password/confirm

type exit

type exit

evan10143 months ago

Thanks for this, now i can't log-in anymore -_- . Somebody Help,

MattC1 evan10141 month ago

Remove the # infront of pi:x;1000:1000:Raspberry Pi User,,,:home/pi:/bin/bash

techieeb147 months ago

I am having trouble following your directions on making the RaspberryPi web server.

I can't run "mv boot_enable_ssh.rc boot.rc" because there is no such directory.

What did you do inbetween Then type "hostname xxxxxx" where "xxxxxx" is what you want to call your server (I chose "raspberryPi" to make it easy).

Please Note that you cannot have any spaces in the hostname.

Finally for this step, type in "ifdown eth0" and hit Return / Enter.
Once that has finished, type "ifup eth0" and hit Return / Enter.

Some personal help would be greatly appreciated.

SSH is already enabled on newer distributions of Debian, so the "mv boot_enable_ssh.rc boot.rc" step is not needed. Everything else is though.

jamesmowrey2 months ago

In the newest distribution of Debian Wheezy, it seems that ssh is already enabled by default. (I tried this step a dozen times, not sure what I was messing up until I Googled it...)

erikm22 months ago

The link to the download for the software does not exist anymore. Can you provide another. Greatly appreciated!


sk_92 months ago

Thank you!
One Question: Once the SQL server has been installed and started, it can be accessed via JDBC from another device in the network? My plans are the following: An Android App which uses the data (and creates new data sets) in the MySQL database on the Pi.

hamcircuit1 year ago
I tried adding that and I still just get a blank page still.
drcurzon (author)  hamcircuit1 year ago
sudo apt-get install phpmyadmin


nano /etc/apache2/apache2.conf


#Include phpmyadmin
Include /etc/phpmyadmin/apache.conf


service apache2 restart

then navigate to:
http://HOSTNAME HERE/phpmyadmin

Let me know how it goes, Dan.

For me works!

Pra mim funcionou! Obrigado Daniel!

I tried this and it doesn't work.
adeoxymus sdobbie3 months ago

I had a similar problem, for me the fix was to go into my FTP client and right click the admin folder and change permissions to 777 for all files and subfolders

don't forget to use sudo before "nano" and "service"
jelimoore2 months ago
I do not know if itis normal, but my web page response time is 9.7 seconds, what is wrong there?
photoace124 months ago
How do you add more users?
or install webmin and use their GUI gui to do almost everything


Would this be able to run an application server? Do you think that it could handle an OpenSim virtual world? Maybe with just 1 to 6 avatars logged in? And if yes, could you make an instruct-able about it? This one is great. you seem super knowledgeable.

Arman55922 months ago
2GB SD card ??? Is it an ssd hard drive or I'm out of date ? Or maybe it's MB ?

2 GB SD card, is a type of flash card, typically used for cameras, for examples:

Arman55922 months ago
Sorry . I didn't understand something :(
jscanlan2 months ago

Great tutorial -- looking forward to others

carloshernani2 months ago

Good job, was trying this for some time.

saved a lot of work.

1-40 of 202Next »