Requirements / Items This has been changed!!
A raspberry Pi (preferably V3 B+), if not V2 with a Network Adapter
sd card reader:
Sd card reader
Raspberry Pi:
Raspberry Pi Model B+
A micro usb cable:
Micro usb cable
And optionally a HDMI cable:
HDMI Cable
Software
This is a way to flash an OS image to your SD card (putting an operating system on your SD card).
A SSH client for you to remotely work with the Raspberry Pi.
This is an SFTP or FTP client that you can use to transfer lots of files to your Raspberry Pi.
Download raspbian buster lite (I personally download the ZIP and extract it onto my desktop)
Great you’ve now got all of the software and hardware to create your own Raspberry Pi Webserver headlessly! The beauty of doing this headlessly is that you don’t have to worry about setting up a screen to your Raspberry Pi or even a keyboard, but you can use it as a fully functional server!
Step 1
Go to the Raspbian link and download the ZIP. Once downloaded open up Etcher.
Run etcher and select the downloaded image, this should be on your desktop that you can see and simply just select, after you have selected your image plug in your SD card reader and select that as your target providing it isn’t automatically selected already.
Then simply press flash!
Step 2 Connecting your Raspberry Pi to your router headlessly
Unplug the SD card reader and plug it back in go to “This PC” in your file explorer and go look for a driver called boot, my drive is (D:)
Setup Network
Create a file called: wpa_supplicant.conf
put this in your boot drive. Adding this script below
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=«your_ISO-3166-1_two-letter_country_code»
network={
ssid="«your_SSID»"
psk="«your_PSK»"
key_mgmt=WPA-PSK
}
The SSID is your network name (you can find that on your router), as well as your password what you use to connect to the WiFi.
Another thing to add to your boot(D:) is an empty ssh file that simply looks like this:
Finding your Raspberry Pi’s IP address
Firstly you’ll have to know what IP address your ISP uses. A quick google search and you should be able to find it.
Once in your router go to the connected devices there you should see the IP address of Raspberry Pi (should have a device name of raspberrypi).
Warning: This can take a couple of minutes on first load for the Raspbery Pi!
If it doesn’t connect see troubleshooting
Raspberry Pi is connected and ready to go
Once you have the IP address you should be able to remote into your raspberry Pi, we do this by openning up PUTTY, type in the IP address of the Raspberry Pi and use port number 22, press open
Troubleshooting
Connect your rpi to a monitor with HDMI Run “sudo raspi-config”, see if there is a network interface In my case I put the wrong ISO code in (UK), when it should of been (GB).
Enable SSH: Add a file called ssh and ensure it’s not got txt as the extension Drag put this file into your boot drive (this enables SSH), which is turned off by default. Creating a Raspberry Pi Ci/CD light switch
Raspberry Pi 3 B+ vs Raspberry Pi 3 B v1.2
A key difference between these two is the Wi-Fi adapter, on the B+ it has a much more supported antenna that connects to 2.4GHz and 5Ghz, however with the 1.2 it will only connect to 2.4GHz so be careful!
Model B v1.2:
Model b+: Model B+ Specs
Conclusion
We’ve now setup a Raspbery Pi that can be used like a web server all for the price of £35, you can use this to practice setting up web sites and servers without having to buy hosting! Something to add to this is that it can be good practice to use this as a way of setting up a pre production server so you can see how your website will look before it’s deployed to production!
More to come will be the different kinds of server stacks you can setup!
A couple Examples would be: MERN, LAMP and JAMstack