How do I connect to another computer over the Internet?

Please be sure to read this guide fully, and ensure that each step is completed, otherwise the connection will not work.

To connect to a VNC Server computer over the internet, you'll need to first configure the VNC Server computer's network, to accept the connection.

Communications between computers on the Internet use an "IP address" to identify each machine, and "ports" to connect to particular services. To "see" a computer connected through a router/gateway you need to pass data through the router to that machine. This is called "port forwarding". Firewalls exist to disallow communication through them, unless it is explicitly allowed.

There are two basic configuration steps that you'll need to perform:

* Configure the firewall of the computer (See section 1)
* Configure the network router, to port forward the correct port. (See section 2)

As with any network application, VNC connects on a port. VNC uses the 'TCP' protocol (you'll need to know this for when configuring your firewall and router) and the default port is 5900. You'd usually read this as:

VNC's default port is TCP 5900.

The VNC Java Viewer's default port is TCP 5800. If you plan on using the VNC Java Viewer, please mimic every single step below for both TCP 5900 and TCP 5800.

1) Firewalls

Configuring a firewall is fairly simple, you need to open TCP port 5900 in the firewalls 'exception' list.

(1a) Windows

Windows XP, Vista and Windows 7 have a built-in firewall, which is on by default, which you will need to configure.

For Windows XP:

* Navigate to Control Panel > Windows Firewall
* Click on the "Exceptions" tab, at the top of the window.
* Click on the "Add Port..." button
* Name it "RealVNC" and set the "Port Number" to 5900, select "TCP" then click OK.
* That's it!

For Windows Vista:

* Navigate to Control Panel > Windows Firewall
* Click on "Allow a program through Windows Firewall", in the left-hand pane.
* Click on the "Add port..." button.
* Name it "RealVNC" and set the "Port Number" to 5900, select "TCP" then click OK.
* That's it!

For Windows 7:

* Navigate to Control Panel > System and Security > Allow a program through Windows Firewall
* Click on "Change settings"
* Click on the "Allow another program..." button.
* Select VNC Server and click "Add".
* Click on "Network location types" and check the "Home/Work (Private)" checkbox then "OK".
* That's it!

(1b) Mac OS X (Leopard 10.5)

* Navigate to System Preferences > Security
* Click on the top "Firewall" tab
* If "Allow all incoming connections" is enabled, you do not need to do anything further.
* If not, make sure "Set access for specific services and applications" is enabled.
* Click on the plus symbol at the bottom (+)
* In the new Finder window, go to /Library/VNC and select "MacVNC" then "Add"
* That's it!

(1c) Third-party firewall

If you are using a 'third party' firewall (Symantec, Kaspersky, Mcafee, Avast, AVG) then you will need to refer to your particular firewall's documentation for how to do this. The easiest option is probably just to search (using a search engine, such as Google) for 'How do I open a port in X' with "X" being the name of your firewall software.

2) Port forwarding

When connecting over the Internet, your router is the external access point to your entire network (whether you have a single computer behind it, or many). See for more information.

Most modern routers use NAT (Network Address Translation), meaning that unless you've explicitly told them otherwise, they will block *all* connections to ports, other than popular ports (such as port 80, which is used for web browsing).

You need to configure your router to forward all connections on TCP port 5900, to the IP address of your VNC Server computer.

Due to the number of different routers out there, we're unable to provide step-by-step instructions for this, but there is a very comprehensive list of routers on the following website, which contains step-by-step configuration instructions, for VNC:

* Navigate to this link
* Please don't confuse the router guides with their commercial 'PFConfig' application - this would require a purchase.
* Find your router make/model on the list, and click on it. If you do not know this, it will be printed on the bottom of your physical router.
* Find 'RealVNC' in the list of Applications, then follow the step-by-step instructions.

3) Important Information

Please note that when configuring port forwarding, you need to ensure that TCP 5900 is forward to your _internal_ IP address. That is, the address of your VNC Server computer.

External IP address = IP address of your router, which you will use when connecting via VNC Viewer, over the internet

Internal IP address = IP address of the computer running VNC Server, used when configuring port forwarding, and connecting internally on your LAN.

You can find out your **Internal** IP address, by:

* Navigate to your Start menu and find 'Run' (Under Windows Vista, you can simply use the search bar, instead of run)
* Type "CMD"
* A Command Prompt should now open up. Type "ipconfig".
* Your Internal IP address will now be displayed.

You can find out your **External** IP address, by:

* On the VNC Server computer, open up a browser (Internet Explorer, or Firefox).
* Navigate to
* This is your current External IP address.


You can now connect from VNC Viewer, using the External IP address of your VNC Server computer.

Related Articles

No related articles were found.


No attachments were found.

Visitor Comments

Article Details

Last Updated
2nd of April, 2014

Would you like to...

Print this page  Print this page

Email this page  Email this page

Post a comment  Post a comment

 Subscribe me

Subscribe me  Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF

User Opinions

88% thumbs up 11% thumbs down (63 votes)

How would you rate this answer?

Thank you for rating this answer.