If you are using an HDMI screen and a USB keyboard, ensure they are plugged in before powering on the Pi. You will be able to see the boot process on the screen.
Warning
During your first boot a tool called cloud-init is doing configuration. WAIT for it to finish before trying to log in. It typically takes less than 2 minutes but there is a break between the log-in prompt and cloud-init completing. If you interrupt the process you have to start again. You’ll know it’s done when it outputs some more lines after the log-in prompt has appeared.
Once cloud-init finishes, log in using the username and password you entered in the Advanced Setting menu. After a minute or so, Ubuntu on your Raspberry Pi will have fully booted and connected to the network.
To connect to your Raspberry Pi remotely, you need two things (we’ll help you find them):
- Its IP address on the local network
- An SSH client (SSH is a communication protocol between machines)
You have to do this if you are running your device headless, but you might also want to do this if you are not, so you can access your Pi from anywhere.
Determining the Pi’s IP address
The easiest way to determine your Raspberry Pi’s IP address is by opening the dashboard for your wifi router and looking for connected devices. If you set a hostname in the ‘Advanced options’ this should appear as your device name.
If you don’t have access to your router dashboard you can temporarily connect a monitor and keyboard to your Raspberry Pi and run:
hostname -I
Which will return your device’s IP (Note: in this case the command uses the actual word ‘hostname’, not the hostname you defined in Advanced options!).
Using an SSH client
On Ubuntu and Mac OS, an SSH client is already installed. If you are on Windows you can either use Ubuntu on WSL or the built-in SSH client in the Windows terminal.
Open a terminal and run the following command:
ssh <username>@<Raspberry Pi’s IP address>
or
ssh <username>@<hostname>
If you set one up in the Advanced options menu.
You will be asked to confirm the connection:
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Type “yes” to confirm. You will then be asked to sign in with your username and password
Default users
If you did not create a username and password in the Advanced options menu, the username and password will both be ‘ubuntu’ by default and you will be asked to create a new password at this stage. Once done, you can reconnect again with the SSH command and the new password.
Success! You are now connected to Ubuntu Server running on your Raspberry Pi.
Still not connected to the internet?
Sometimes the structure of the network-config file that you modified before boot gets messed up when you boot. This would cause your Pi not to be able to connect to your wi-fi.
To fix this you need to go into the correct file and correct the issue. Run:
sudo nano /etc/netplan/50-cloud-init.yaml
so you can edit the file. Edit it so it looks like this again, the indentation needs to be correct for the .yaml to work:
wifis:
wlan0:
dhcp4: true
optional: true
access-points:
"home network":
password: "123456789"
Save and exit the file with Ctrl + S
and Ctrl + X
.
Run sudo netplan apply
and sudo reboot
and when you log back in, you will be connected to your wifi.