In last tutorial, I guided how to install Teamviewer on Raspberry Pi to remote Raspberry Pi.
In this tutorial, I will go through the all the steps to setting up a Raspberry Pi VNC server. Once we have done this, you will be able to remote desktop to your Pi, so you’re able to control as if you were sitting there with it.
The process of setting VNC all up is pretty easy, and at the end of it, you will be able to control the desktop of the Pi remotely.
This software is incredibly handy if you don’t have a screen or access to the Pi itself. If you just want a barebones command line approach, then be sure to check out the tutorial on how to SSH into your Raspberry Pi. This method is how I control my Pi pretty much all the time, but it all just comes down to preference.
It’s important to mention that Raspbian now has a VNC server package pre-installed. You can still do this tutorial if you wish otherwise go into the Raspberry Pi configuration and turn it on. Once you have turned it on, simply connect using the same steps as described in this guide.
To complete this Raspberry Pi remote desktop tutorial, you will need the following pieces of equipment.
SD Card or Micro SD Card if you’re using a Raspberry Pi 2, 3 or B+ (8gb+ is recommended)
Ethernet Cord or Wifi dongle
Raspberry Pi Case
If you want to see how this is all done, then be sure to check out my video below. I go through all the steps from start to finish on getting this setup correctly in no time at all.
If you do like the video and would love to see more, then please make sure you subscribe.
Can’t see the video? Please support us by disabling your adblocker.
Installing the Raspberry Pi VNC Server
As in all of my tutorials, you will need to have Raspbian pre-installed onto your Raspberry Pi. If you haven’t already done this, then you can find out how to do it all in my guide to installing Raspbian.
Now installing the VNC server software package onto your Raspberry Pi is actually incredibly easy and only requires entering a couple of commands.
1. Before we get started first make sure your Pi is up to date by running the following commands:
sudo apt-get update sudo apt-get upgrade
2. Once those two commands have finished running, enter the following to install the tightvncserver.
sudo apt-get install tightvncserver
3. Now, set up and run the VNC server, this is pretty easy to do. Simply run the following command:
4. You will now need to set up a password for when you go to connect to the Pi remotely via the VNC client. It is important to remember the password will be truncated to eight characters so try and choose a password that works best for you that is no longer than eight characters long.
5. It will next ask you to verify the password, enter it again.
6. Next, it will ask if you want a separate view only password, simply enter “n” for this.
7. Once that is all done, the server will be up and running. The following command will need to be run every time the Pi reboots, or for some reason, the process is stopped.
The Raspberry Pi VNC server should now be up and running correctly. If you want to have the software startup automatically at boot up then simply follow the next couple of steps, otherwise we’re ready to setup the client side of things.
Having the VNC server start automatically (Optional)
Having to run the command above is not ideal so you might want to have it start automatically whenever your Pi is booted up.
The following steps are pretty straightforward and will take you through the steps of having the server startup on port 1 at boot up.
1. First, open up the rc.local file by entering the following command.
sudo nano /etc/rc.local
2. Now enter the following before the exit 0 line.
su - pi -c '/usr/bin/tightvncserver :1'
3. Save and exit by pressing ctrl + x then y.
4. Restart the Pi by running the following command.
5. You can confirm that it is running by running the following command.
6. It should say “A VNC server is already running at :1”
7. If you need to kill the server simply enter the following command (Change 1 if you’re using a different port):
vncserver -kill :1
Once you’re done, you can proceed to set up the client on your other computer, tablet or whatever device you plan on using.
Setting up the VNC client on your PC
Installing and setting up a VNC client on your computer is incredibly easy. There are quite a few different VNC software packages out there, but in this tutorial, I am going to be using RealVNC.
1. To begin head over to the RealVNC website and download the VNC viewer client relevant to your operating system.
2. Once downloaded, simply open it up. (If you want server software as well you will need to download the full software package.)
3. Enter your IP address with the port 1 in the field that says VNC server. For example, mine is, 192.168.1.108:1
4. Now simply press connect.
5. It should then give you a warning message, simply press continue on this.
6. Then it will ask you for the password you set for it earlier. Simply enter the password that we set earlier.
7. The VNC window should load, and you will now have remote access to your Raspberry Pi.
This process is all you need to do to have Raspberry Pi remote desktop up and running. If you do come across any issues, I have small troubleshooting section below otherwise be sure to leave a comment.
- I can’t connect! – Be sure to double check the IP you entered and make sure it is the same as the Pis. Also be sure to make sure that the VNC server software is running. Most routers also dynamically give out IP’s, so it is possible the IP will change over time. To fix this setup a fixed IP or check the IP whenever you go to connect.
- I want access outside my local network – This will open security issues, but you’re able to do this by setting up port forwarding. Remember the VNC server is running on port 1.
- I want a different/larger sized screen on my VNC client – When you go to start the VNCserver, you can add an extra command called geometry and then the screen size width and high you want (This is in pixels). The command is:
vncserver :1 -geometry 1440x900
I hope that you have been able to setup your Raspberry Pi VNC server correctly and that you’re able to remove desktop to your Pi easily. If you’re still having trouble or that I have missed something, then please feel free to drop a comment below. If you’re looking for more, then be sure to check out some of my latest DIY raspberry pi projects.