How To Host PHP Web Development Projects For Free on Windows Or Linux.

How To Host PHP Web Development Projects For Free on Windows Or Linux.

How To Host PHP Web Development Projects For Free on Windows Or Linux. 


Are you looking for a free hosting for your web development project for testing or maybe you want your friend to access and use the website but you don't want to spend on hosting service for that, then today we will discuss how to host your PHP web development project for free and get a free domain name to access it throughout the internet.

Note: This solution will work for any web development stack But I am specifically making this tutorial for PHP, MYSQL users. But again, If you want this tutorial for some other stack then just let me know.

Ok, then lets dive in.


1. Any web server like XAMPP, WAMPP (i will use XAMPP). If you do not have one please download it from this link here. Linux users don't need any of there.

2Ngrok for creating secure URL for accessing local server throughout the internet.

3. Active internet connection.

That's all you need for now and you are good to go ahead.


1. Create a new Project folder inside C:\xampp\htdocs\

NOTE: This location should be the same if you haven't customized the xampp default installation location.
Linux user can create a new project folder inside /var/www

2. Start your XAMPP web server. (Beginners can follow this post Running xampp server with a project)

3.. Download ngrok if you haven't downloaded it yet. You will get a RAR file, extract it inside your project folder in our case C:\xampp\htdocs\YOUR_PROJECT_NAME

4. Run the EXE file. Command Prompt will pop up with some helping content to get started.

As you can see you can do some bunch of stuff with it, like transferring data or accessing the local server. Yes, we are going to use the HTTP 80 to access the local web server.

NOTE: After running the EXE if you are first time user then you have to insert this command first

ngrok.exe authtoken <YOUR_AUTHTOKEN>

You can get YOUR_AUTHTOKEN from get started dashboard. Linux users can follow ngrok get started guide

5. Run the project with the below command

ngrok.exe http 80

you will get a new window like this
ngrok server

6. Go to the URL written in Forwarding row, in my case
Voila!, you get your default xampp dashboard. 

7. To access your project just append a /YOUR_PROJECT_FOLDER_NAME/PROJECT.PHP
or any index page of your choice. You are done. Share the full link with any of your friend and they can access your project from remote PC.

NOTE: Keep in mind that your URL is not static every time you close ngrok and restart, they will dynamically allocate you a new URL. But you can get a static URL using ngrok paid service.

That's all, for now, hope you like it.


Post a Comment