Turn Raspberry Pi in to a LAMP server

From artserver wiki

This recipe will take you through the steps of creating a LAMP on a Raspberry Pi to host a Mediawiki, which you can run from home and yet access it through from any location with an internet connection.

Steps will be described for the GNU/Linux Debian distribution.

Get the Raspberry Pi up and running

Download the Raspbian Buster Lite image from https://www.raspberrypi.org/downloads/raspbian/

Clone it to SD card

dd if=2020-02-13-raspbian-buster-lite.img of=/dev/sda status=progress
  • as root
  • of= is the location of the sd card if you are not sure run lsblk to find out

Once cloning is finished:

Enable ssh: mount the sd card to you computer and add to the boot partition (the smallest one) an empty file called ssh

Unmount it and place it on the Pi: Note: Pi must be off. Never ever do move the SD card in or out when the Pi is running. Changes are you end up with corrupted SD card

Connect the Pi with a network cable to your home router and power it.

Connect to the Pi

Find the Pi's IP address by going to your home router web interface and look for the Pi IP address in the Local Area Network.

SSH to the Pi:

ssh pi@PI.IP.ADDRSS
  • default user: Pi
  • default password: raspberry