Building the Raspberry Pi Server

Connecting to Wi-Fi

Now, you need another file in root of the “boot” parition called “wpa_supplicant.conf”. Similar to how you had created your ssh file, open any text editor and paste the following into the text editor:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
country=<Insert 2 letter ISO 3166-1 country code here>

 ssid="<Name of your wireless LAN>"
 psk="<Password for your wireless LAN>"

There are three edits that you have to make:

  1. If you had read the basic explanation of the hardware, you will remember that Wi-Fi 5.0 Ghz does not work in all countries as per regulations on radio waves in the particular country. Entering your country code will enable Wi-Fi to operate in the 5.0 Ghz frequency. In my case, I would enter “CA” for Canada. You may enter “US” for the United States, or find your country code here.
  2. Enter your network name.
  3. Enter your network password.

Save your file as wpa_supplicant.conf on the root of the “boot” partition.

I don’t have Wi-Fi (optional read)

I prefer connecting via Wi-Fi for the convenience and flexibility of placing your Pi anywhere in your home but if your desired location does not have a fast and/or stable Wi-Fi connection, or just you just don’t have Wi-Fi, then you can connect to your network via Ethernet.

I highly recommend connecting your Pi directly to the router for an always-available connection.

If you cannot put your Pi near the router and don’t have an Ethernet cable long enough for the connection, you can connect to your computer to share its Wi-Fi connection. Note that your computer has to be on for your Pi to have access to the network/Internet.

Plug in your Ethernet cable to your Pi and computer.

On Windows, open “Control Panel” -> “Network and Sharing Center” -> “Change Adapter’s Setting”.

Right-click on your Wi-Fi connection and go to “Properties”.

Click on the “Sharing” tab.

Click the checkbox next to “Allow other network users to connect through this Computer’s internet connection”.