Remote access a Raspberry Pi

Minimal config, VNCServer running on raspberry Pi
Minimal config, VNCServer running on raspberry Pi

This article will show you how to remote access a raspberry Pi running on raspbian. I have chosen to selecte a VNCserver. Installing a VNCserver is really easy. Therefor in order to do it you need to have either SSH already enabled or have a monitor, mouse and keyboard plugged in.
See below screenshot and lets enable SSH. This way we are able to access the Raspberry Pi via command line in order to install VNCserver. After you enabled SSH you have to reboot your raspberry Pi. (Ignore the VNC)

SSH will be enabled after a new reboot. In order to always connect to your raspberry with the same IP address, you need to know the IP address. There are 2 easy ways to control that.

  • Static IP address for your raspberry (harder to change later)
    You would need to modify the following file /etc/dhcpcd.conf
    #sudo nano /etc/dhcpcd.conf
  • When a firewall is used in your house then use a DHCP address reservation or static mapping. (I prefer this method because it provide more control and in addition it is faster)

Firewall changes:

For me the easiest is to login to the firewall, Menu – Services – DHCP Server – DHCP Static Mappings and configure one entry:

MAC address: b8:27:eb:c6:64:34
IP address:
hostname: raspberrypi3
description: Pi2 – Dev

Raspberry changes:

none. Leave your raspberry on DHCP (standard), the next time it is rebooted it will have the  IP address you configured.

VNCserver install:

Now, everytime your raspberry boots it will have the IP address you setup in your DHCP static Mappings. In our case
Since SSH is enabled and we rebooted, we can now access the raspberry Pi via SSH from our host system.
I use Ubuntu and open a terminal window. (Under windows there is a software called Putty you can download for free)
The default user on the raspberry Pi is “pi” and the default password is “raspberry”. Always change the default password of the user “pi”. The easiest way is to open again the Raspberry Pi Configuration – System and click the “Change Password …” button

It will look like thisNow we are ready to install VNCserver, but before we start, we update the raspbian OS again, therefore use the following:
#sudo apt update
# lets upgrade to the latest OS patches
#sudo apt upgrade
# lets install both the VNC server and viewer
#sudo apt install realvnc-vnc-server realvnc-vnc-viewer

A reboot should not be needed, however if you want VNCserver to start automatically next time you boot, you have to enable VNC. Menu > Preferences > Raspberry Pi Configuration > Interfaces and make sure VNC is set to Enabled.

Enable SPI services
Enable SPI services

Connect to the raspberry Pi via VNCViewer from your hostsystem:

download and install real vnc viewer on your windows, mac or linux host system and run it
Do NOT forget to disable SSH again.

Other usefull Commands:

#sudo dpkg-reconfigure tzdata  (In case you need to update your timezone)
#sudo raspi-config (Just in case you want to make changes from the command line)

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published.