LAMP Server on Raspberry Pi – Step 1 – Setting up Linux

In LAMP Servers, Raspberry Pi, Tutorials by Orbit20 Comments

Hello, welcome back, firstly thank you for following our LAMP Server on Raspberry Pi tutorials.

I will assume you already have your Raspberry Pi ready, this tutorial will work on any version, if you don’t have one yet your local electronics store may stock them, or mail order one from Amazon, I would also recommend getting a case for it too.

In this tutorial we are going to look at Linux on the Raspberry Pi and how to install it, use SSH and get to know a little bit about it.

Wait, what? SSH? Yes SSH (Secure Shell) this is a way to connect to your Raspberry Pi through command line (CLI) across your LAN (Local Area Network), connections within your premises which are connected to your router.

Mostly in these tutorials we will be doing the setting up through command line, I find as we are setting up a server rather than a computer, we need to get used to having a remote computer, but don’t worry, I will walk you through the commands, it’s not as daunting as you expect.

What you will need:

  • Raspberry Pi.
  • MicroSD card I recommend 8gb (most times supplied with RPi)
  • MicroSD to SD Adapter. (most times supplied with RPi)
  • A Computer (Windows / Mac / Linux).
  • Internet Connection.
  • A RJ45 Network cable.

If your Raspberry Pi comes preloaded with Noobs or PIXEL you may skip the first step.

  1. We need to download PIXEL onto a computer any will do but you will need a memory card reader with a SD Slot to put the operating system on later. Download Here.
  2. Unzip your download into a folder where you can easily find it, this will unzip an .img file, this is the full operating system, but this needs to be written to the card in a way the RaspBerry Pi will read it to boot the device.
  3. With there being 3 main operating systems, Linux, Windows and Mac there’s different ways to write your .img file, so Raspberry Pi have put the following user guides together to help you, if you’re still struggling comment below and I will answer you with help and pointers.
  4. Once you have written to your memory card we can get started with our Raspberry Pi, simply place the MicroSD Card into the Raspberry Pi, plug it in and connected the network cable to the Raspberry pi and your router, it usually takes a couple of minutes to start up.
  5. This step can be a little tricky, you will need to log on to your router to find the Raspberry Pi’s IP address which usually starts 192.168.x.x, in your router you should have an option to view connected devices, the Raspberry Pi will normally show up as unknown (really helpfull…not)! If you see an IP you know is new then great, write it down and move to step 8, if not make list of unknown addresses and I will show you how to establish the correct address in the next step.
  6. Now on your main computer open up command line or download PuttySSH for Windows which is a GUI Interface for SSH, for Mac/Linux use Terminal, I will be using Terminal in Mac but the commands are the same.
  7. On the cursor in command line type ssh [email protected] (x.x being the last 2 number blocks of your notes from step 5) if you get no connection press control + c this will return you to your prompt and try the next until you get a connection, this will be the IP of the Raspberry Pi.
  8. On the command line type ssh [email protected] you will now be prompted for the password which is defaulted to raspberry, now you should be connected to the Raspberry Pi remotely.
  9. We now need to change the password for security, at the prompt type passwd then press enter, you will now be prompted to enter the current password then your new chosen password.
  10. Now we have changed the password, we are going to continue using the Raspberry Pi as root (superuser) to do this type sudo su.
  11. Finally lets check everything is up to date by typing apt-get update now you should see lots of lines updating the operating system.

An image of terminal changing passwordAn image of terminal connecting to a raspberry pi connecting as super user An image of the terminal updating linux

Congratulations you have now installed Linux on to the Raspberry Pi.

If you liked this tutorial please like & share.

I hope you’re looking forward to the next tutorial where we will install Apache HTTP Server.


Leave a Comment