Menu Close

Raspberry Pi Webserver Guide

I run this website and most of the systems it relies on are off of my own, self hosted servers. These are 2 Raspberry Pi computers. Here’s links to the guides I’ve used to install Ubuntu, Diet Ubuntu, and LAMP onto them. They run extremely well and are very reliable, besides the issues associated with using consumer-grade SD cards for storage and their lack of RAM or processing power. 

Install Ubuntu, I prefer the MATE distribution that’s compiled for ARM architectures. This guide assumes you have a basic knowledge of flashing images to SD cards using programs like Etcher, and going through GUI OS installations.

1. Install Ubuntu onto your Raspberry Pi initially. Write the .img file you download to a MicroSD card using Etcher or similar software. 

https://ubuntu-mate.org/raspberry-pi/

You’ll need a keyboard, mouse, and monitor temporarily connected to the device for the initial install. 
2.  Install Open SSH for remote access.

$ sudo apt-get install -y openssh-server
$ sudo systemctl start ssh
$ systemctl enable ssh.socket

Enable SSH-Server from the terminal and make it autostart on reboot. The last part is critical, if you don’t have it autostart you can’t access the server remotely and be forced to manually connect to it. SSH allows us to remotely control a computer from the command line over the internet. 

3. Now remotely connect to your server at it’s local IP address from another computer on the same network. You can find it’s IP address by looking at your router’s configuration page or executing “ip addr show” from terminal on the Pi. You’ll login using the username and password you setup when installing Ubuntu.

4. I  recommend removing all uneeded programs using this guide here:

https://help.ubuntu.com/community/Diet%20Ubuntu

Also, remove the desktop as you won’t need it this way:

https://askubuntu.com/questions/784905/completely-remove-mate-desktop-from-ubuntu-mate-16-04

5. Now for the fun. Install LAMP (Linux, Apache, MySQL, PHP) using this guide from DigitalOcean:

https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04

That’s essentially it! You have your own self-hosted website up and running.