This guide explains what you need to do in order to set your XAMPP server on either Windows, Mac or Linux go onto the internet so others can access it online.
I’m writing this tutorial because I could find no easy to follow instructions on how to configure a XAMPP web server to work over the internet live and not just with localhost on your local computer.
How to Setup XAMPP to work Live on the Internet
- First we are basically assuming that you have already had XAMPP set up and running on your localhost for local development and that you just need to change it to go live online. If that is not the case and you still need to install XAMPP, go to this site and install it before continuing: https://www.apachefriends.org/download.html. Then continue to the next step after you have it working on http://localhost.
- Next, go to your router settings admin page and set up port forwarding to the machine that you installed XAMPP on. Usually you can access your router admin by going to http://192.168.1.1/ and logging in. If you have a netgear router, you can also use http://routerlogin.com as well as 192.168.1.1 to access your router’s admin area. I’ll include the basic steps for a netgear router here and they should be similar enough for you to figure this out on most other routers, but if you have difficulty, you may need to consult your router’s documentation or support to get the exact process for setting up port forwarding. Here are the steps to set up port forwarding on Netgear Routers:
- Navigate to http://routerlogin.com in your browser and login using the username and password you set up for your router. If you didn’t set it up, the Netgear defaults usually use username “admin” and password “password” so try that before trying to reset the password or calling support if you don’t know your username and/or password.
- Find the local IP address for the computer that has your XAMPP web server installed on it. As long as you can access the internet from the computer with XAMPP installed on it, you can find the IP address in the Netgear admin by clicking on the “Attached Devices” link in the left navigation bar of the router admin page.
- Once on the “Attached Devices” page, you should be able to locate your web server computer by it’s name or mac address. Write down the IP address for your records and to use in the next steps of this tutorial.
- Next, to back to your router admin’s left navigation menu and click on the link that reads “Port Forwarding / Port Triggering”. Then enter the IP address from the previous step into the “Server IP Address” field.
- Then click the “Service Name” dropdown and select HTTP. After that, click the “Add” button to add the service with your web server’s IP address and you are done!
That’s pretty much all there is to it as long as your XAMPP was previously working on your localhost. Now go to WhatsMyIP.org and make a note of the IP address it gives you because this should be the IP address of your new web server now if everything is working like it should. Go to your browser and type in that IP address and you should now see the same things that you used to see by typing “localhost” into your browser’s address bar.
WARNING! This guide doesn’t take security into consideration at all. It is meant as a temporary solution to show someone your server online for a brief period of time and then it should be taken offline unless you go through all the necessary steps to tighten the server’s security. Then you could keep it online as long as you wish, but security would need to be an entire tutorial by itself. Google it for more information or read how to lock down your server in the XAMPP docs. Good Luck and enjoy your new web server!