1

I'm running a webserver off of a Raspberry Pi. My problem here is that it doesn't work outside of my home network; anywhere else, the computer can't connect. It's a LAMP server, which I set up using this instructable. I think that it has to do with public/private IP's; how can I make my server accessible to the outside world?

My router is a Netgear WNDR3400.

11
  • You need to set up port forwarding from your router/modem to point to your raspberry pi.
    – Darius
    Feb 4, 2014 at 23:27
  • We can even help you with this if you add information about your home router, and the ports you wish to forward.
    – G Koe
    Feb 4, 2014 at 23:30
  • @Darius, @G Koe: Well, the port I use to SSH into it and for SFTP is 22. I have options for External Start Port, External End Port, Internal Start Port, Internal End Port. I'm guessing that my Internal End Port should be 22, but I'm not sure what to do with the rest.
    – evamvid
    Feb 4, 2014 at 23:39
  • What is your router model? And your website should be running on 80 or 443. Feb 5, 2014 at 0:14
  • @AlexMcKenzie Netgear WNDR3400. How do I change the port? It defaulted to 22. But isn't port 80 used for localhost?
    – evamvid
    Feb 5, 2014 at 0:16

1 Answer 1

1

Just to gather up everyone's comment and to put a few things in the clear

Web Server uses port 80 (HTTP), or 443 (HTTPS). Your Raspberry Pi web server will be running on either one of those common ports if it is serving web pages. Of course you can use a custom port to your need, but then to access the web pages on the raspberry pi, you need to include the custom port number on the URL (eg. www.raspi.com:8080 or if using IP address: 10.0.0.1:8080). If you simply type in the URL with either http or https (eg. http://www.raspi.com or http://10.0.0.1) then it will be port 80 and 443 respectively.

Your SSH session to your Raspberry Pi uses Port 22 as it is the 'default' port for Secure Shell.

For more information about reserved/common ports, please check this wiki

Now to answer your question

how can I make my server accessible to the outside world?

You need to let your Home Router (Netgear WNDR3400 as you have mentioned) to do PORT FORWARDING. By default (and for security matter), any router should have a built-in firewall that would block unsolicited request coming from outside into your home network, which is what it has done for you. For specific port-forwarding instructions for your home router, please follow this link from portforward.com

The basic idea on how to set up port forwarding:

  1. Login to your router
  2. Find your port forward page on the router
  3. Set up Port Forward 80, to Port 80, on the IP of your Raspberry Pi

To test if this is working:

  1. Open your browser
  2. Open your external IP address. If you don't know what is your current external IP, you can go here to check.
  3. If your port forwarding is done correctly, and your Raspberry Pi is serving pages correctly, you should be able to see your web pages that are hosted on your Raspberry Pi.

Hope this helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .