Introduction
This document will walk you through everything to get your Raspberry Pi set up and ready for use. You will be making your Raspberry Pi in a headless configuration. A headless configuration is when you have no monitor hooked up to the computer. Normally you would create you boot drive, and use a monitor to configure your computer. With this we will be able to connect to the Raspberry Pi over the network.
Matrials Required
- Raspberry Pi
- 8GB minimum MicroSD card
- MicroSD card adapter if you do not have a MicroSD reader
- Computer with at least 4GB of spare space
Prepairing the OS boot drive
First download the Raspberry Pi OS lite img, formerly known as raspbian. Then unzip it. https://www.raspberrypi.com/software/operating-systems/
Raspbian is the operating system based on debian which is origin for other distributions (distros) of linux like Ubuntu, Linux Mint, Pop!_OS, and many many many others.
Now download Etcher. This will let you create a boot drive on the MicroSD. https://www.balena.io/etcher/

Once etcher is installed, plug in your sd card and open etcher. Then select the raspbian img from the folder you unzipped. Flash should now be blue, click on that and let it finish.

Next, go to the boot drive in finder or file explorer. If you do not see it, unplug it and plug it back in.
Then create a file called ssh on the drive. It is fine if it has ‘.txt’ at the end. Eject the drive from your computer.
Put the MicroSD into your Raspberry Pi and turn it on.
Finding the IP Address of your Raspberry Pi
Now you need to find the ip of your pi. You can do that in a few different ways. You can look on your router and the client list. Another way is to use an app like AngryIP. You can download AngryIP here https://angryip.org/download/
Once its installed: click on the gear icon, display, select click on alive hosts, then click okay. After that, click on ip, ping, or hostname. Click on select fetchers, add mac address and mac vendor then okay. Press start. When finished, look for the mac vendor that says Raspberry Pi and the IP address that is has.
SSH to your Pi
Next we will SSH to the pi. **SSH** stands for Secure Shell and Shell is a the way to interact with your computer with commands. On your computer, open a terminal. Windows it is CMD, on Mac it is terminal. The way to use ssh is like this ssh username@ip_address, so to ssh into your Raspberry Pi it will be ssh pi@your_pi_ip. Replace your_pi_ip with the ip address you found for it. In the end, it may look like this ssh pi@192.168.1.102. The password by default is raspberry.
Change default password
Now you should be ssh into your Raspberry Pi! First thing you should do is change that password to something not default. To do this put your new password into your password manager or whatever you use to store your passwords. Then type passwd. This will let you change your password. It will first ask you for your current password and the new password.
Updating your Pi
After your password is changed, you should now update your raspberry to make sure it is completely up-to-date. To do this type sudo apt update. **Sudo** stands for Super User do. This is your account asking for permission to perform a higher privilege command. **Apt** stands for Advanced Package Tool and this will change depending on what distro you are using. For example Arch uses pacman, CentOS uses yum, and FreeBSD uses pkg. Once you press enter, it will ask for a password. This will be the password you just changed, then will ask again if you want to install them. When the update finishes, it will return you to the prompt to await for another command. Next you will install all the updates you just downloaded with sudo apt upgrade.
Now your Raspberry Pi is fully updated. To the super fun stuff (since its all been fun so far right!). To have your html page show like a normal webpage like google.com or youtube.com, we need something that knows how to display that information and know how to talk to your computer in the same language. This language is called a protocol. For webpages we use the hypertext transfer protocol or known as http. Then there is the secure version of http called https. This is what you should be using when going to public websites like youtube.com. For this tutorial you will just be using regular http as it is easier to set up. A package that we can install for this is Nginx (pronouced as ‘Engine-x’).
Installing Nginx
To install this package type sudo apt install nginx. When it finds the package and all the dependencies it requires, it will ask if you want to install it. Finding the package and dependencies is like cooking, to make a cake you need milk, eggs, vanilla, and flour. All of these let you create the cake, same thing for Nginx. It requires other things to make sure that it works correctly.
Changing to Nginx directory
With Nginx installed we can now get to work on adding your webpage! Now you can not just add it anywhere. Nginx is looking in specific spot, this spot is /var/www/html. This is a file directory. It is how your computer is completely made up of. To get to this directory we type cd /var/www/html. The command cd stands for change directory. You are now in that directory and that should be reflected on your prompt, it should look something like pi@raspberry:/var/www/html $. If you type ls and press enter. You will see the files in this directory and ls stands for list. There should be one file here. Let us see this file.
Go to your browser and type http://your_pi_ip, again replace your_pi_ip with the ip of your pi. You should now see a page that says welcome to Nginx.
Creating your webpage
Back to your terminal. Type rm index (then press tab, this will complete the file name). The rm command is remove and it is removing the default file. Now type sudo touch index.html style.css. What this does is create two files called index.html and style.css. Open your html text on your computer, select it all and copy. To edit the index.html file, type sudoedit index.html, then control+v to paste your text. control+x, y, enter to save and exit. Do the samething for style.css.
Copying images to your Raspberry Pi
You have some images that are on your webpage. This is slightly more tricky but not too difficult. Open a new terminal or cmd. Now navigate to the folder with your html text and photos. For this example I will say your files are like this Documents/Website/images/. Next type pwd if you are on mac, cd if you are on windows. This will tell you the current directory path your are on, you will use this in the next command. Now onto the command, this command format is rsync source destination. For our example you are copying files from a mac to your Raspberry Pi. rsync /Users/johndoe/Documents/Website/images pi@your_pi_ip:/var/www/html/
This copies the images folder to your html folder. This is how you should copy files from one computer to another when using the command line. As you can see, we could have accomplished the same for your index.html and style.css.
Checking out your cool website!
Sweet! You now have your index.html, style.css, and images! Now go back to your browser and refresh the page or go back to the ip of your Raspberry Pi. You should now see your website!
In this you learned how to create a headless install of raspbian, ssh into your pi, update and install packages, change directories, copy files from one computer to another, remove a file, list contents in a directory, create and edit files, and change your password!