How to host your own website using WAMP Server
So you want host your own website, well you found the right post. If you have a spare Windows machine and some time, I will show you how to host your own website using WAMP server from your home or office. In this post I will show you the steps I took to configure WAMP to start my web server and host my own website for testing and personal projects.
You may have one or several reasons why you would want to host your own website, perhaps you want to:
- host a small personal blog.
- host a portfolio site.
- host your resume.
- test a web application.
- or just simply learn how to setup your own web server, of course.
Any of these project can be easily hosted from your own web server without having to pay a company for web hosting. However, I would NOT recommend this approach if you are doing anything complex, like a business or eCommerce site, or generally a site that you expect to grow and get a lot of traffic, as most ISP would not allow this and even if they do you will probably end up having to invest more time and money on better software and hardware to keep up. Rather, I recommend using a good web host, like SiteGround or GreenGeeks, to do these types of projects.
In my case, I want to test a tool like MainWP without the restrictions of a web host and I do not want to spend a lot of money for VPS hosting, so for me it makes sense to run this on my own web server. I have an HP ProLiant mini server which is a nice and small eco-friendly machine that is always on. Hosting my website on it will not only save me money but it will allow me to change any parameters typically not allowed in shared hosting plans, like memory limits and max execution timeouts (ugh!).
The mini HP ProLiant machine runs Windows Home Server 2011 and it is ideal as a personal or even as a small business web server. But technically, you may do this on any reliable machine running Windows 7, 8 or even on another operating system, although this post is geared towards Windows users. The HP mini server runs quiet and cool, so you may want to consider how loud and how hot your machine gets if you plan on using it as an ‘always on’ server.
In my case, I will need to consider any roles my server has before adding WAMP to serve my web pages. Currently, my server is running IIS to allow me to view, save, and retrieve files from my home network as well as from the outside world via a web browser. If I want to use WAMP Server, I will need to disable the IIS service.
Once you have taken the above into consideration you should be ready to begin. Well enough talk and lets get started.
Install WAMP Server
I have a separate post on how to do this if you need help with this step. Simply download wamp server from wampserver.com/en/ and take the defaults. Once it is installed you will notice the green light on the wamp icon on your system tray.
If the icon is red or orange, you have a conflict with another application. In my case, most of the time I encounter this issue is if IIS is running on the machine. You can check what service is using port 80 if you want to confirm this. Go to Apache –> Service –> Test Port 80 and see which service is using port 80. If IIS is using the port, you will want to disable the following service: IIS Admin Service and World Wide Web Publishing Service.
You can check out my post on troubleshooting the orange status light in WAMP Server for additional help with the orange status light.
Set WAMP Server to run on automatic
Configure the ‘Startup Type’ under Window services to automatic for both wampapache64 and wampmysqld64 services.
Now you will want to make wampmanager.exe start when Windows starts. So in case you re-start your server, or it re-starts itself due to Windows updates, power surges, or other unpredictable cause, your are covered.
Check out my post on Configuring WAMP Server on Windows for WordPress local development for further details on how to do this step.
Configure Windows Firewall to allow wampmanager, port 80 and 443
Port 80 and 443 must be allow for both TCP and UDP packets. To do this, create 2 inbound rules for TPC and UDP on Windows Firewall for port 80 and 443.
Also, allow wampmanager.exe found in the wamp installation folder, in my case that is C:\wamp.
Set the MySQL root password
This is a very important step. I suggest making a strong password with upper and lower case letters and numbers, throw in a couples of symbols too. There are a few ways to do this, one is by going to the MySQL console and typing the appropriate commands, another way is via the GUI (graphical user interface) using SQL Buddy or PHPMyAdmin. Go to my post on how to set the Root password for MySQL for steps by steps instructions on how to do this.
Configure phpMyAdmin to require a password. Open the config.inc.php file found in C:\wamp\apps\phpmyadmin[version#] and edit the following:
On the following lines..
$cfg['Servers'][$i]['auth_type'] = 'config';
Change ‘config’ to ‘http’.
$cfg['Servers'][$i]['user'] = 'root';
Delete user root and just leave the quotation marks empty, like so = ‘ ‘;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
Change true to false.
Create a Log Out URL by adding the following line..
$cfg['Servers'][$i]['LogoutURL'] = 'http://your-external-ip-address/';
Now, if you have a static IP, you should be ok entering it here. But in case you do not, like most of us, then you will want to enter the domain you plan on using for your website (recommended).
Save your file and go to http://localhost/phpmyadmin – You should be prompted for a user name and password now.
Now we need to make Apache listen to port 80 on our host machine. For this, open your httpd.conf file found under C:\wamp\bin\apache\apache[version#]\conf and edit the following lines:
Listen 0.0.0.0:80 ServerName localhost:80
Change it to..
Listen youripaddress:80 ServerName youripaddress
where youripaddress is equal to the local ip address of your web server.
Find <Directory “c:/wamp/www/”> and enter:
Order Allow,Deny Allow from all
right before </Directory>
Save the file.
Configure PHPMyAdmin Alias file
This will allow us to access PHPMyAdmin from the web. Open phpmyadmin.conf found in C:\wamp\alias and edit the following line:
and replace it with..
Require all granted
Save the file. You should now be able to access the site via http://youripaddress and PHPMyAdmin via http://youripaddress/phpmyadmin
Please note that WAMP Server is commonly used for local development, and not as a hosting platform for production as it is inherently un-secure. However, you can take some measures to secure it like the ones I am going to suggest here.
Here are a few things to check for: Open your httpd-default.conf file found under C:\wamp\bin\apache\apache[version#]\conf\extra and make sure you set the following parameters..
This directive configures what WAMP returns as the Server HTTP response, setting it to prod returns the least info.
This will stop Apache from broadcasting the server signature, which includes server version and virtual host name and other possibly sensitive information.
This will help prevent DoS attacks. It should be 60 by default but check just in case.
Re-start all services if you haven’t been doing so by clicking on ‘Restart all services‘.
You are almost done, next step is to remove the files in the www folder. You can delete them or move them to another folder outside www.
You can now place your website files in here.
For additional security, I suggest placing an index file in the root and any sub directory of your website.
Adding an htaccess file with an unauthorized directory browsing rule would be ideal. You can drop this line in the .htaccess file:
#to disable directory browsing
Options All -Indexes
and place it in your root (www) and that should take care of things. To create an .htacces file in Windows check out this post on StackOverFlow. Also, check out Perishablepress htaccess tricks page for some cool things you can do with htaccess files to greatly enhance your websites security.
I wrote this tutorial based on my own experience with WAMP and what I have learned from others on the internet. I am not a security expert so if you have any suggestions on how to further secure WAMP or you have some best practices please feel free to let me know in the comments below.
Forward web traffic to your web server’s IP.
If you are reading this, I am going to assume you are somewhat familiar with port forwarding . But if you need help, just type ‘port forwarding’ in Google and you will get many sites that will show you how to forward a port. Basically, you want to forward any web traffic on port 80 to your machines local IP address. If you plan on using ssl, you may also want to forward port 443. On my router, it looks something like this:
Put WAMP Server online
The last step is to put WAMP server online.
You did it! Now sit back, enjoy some tea and watch your web server do what its meant to do, serve your web pages to the world!
Hopefully this will help you in your current and future web projects. If you have any questions about this setup please leave me a comment below and I will be happy to help.
Thank you for stopping by.
Disclosure: Please note some of the links in this post are affiliate links, which will allow me to get a small commission if you end up purchasing/or using the recommended product. You will be helping me out and the cost of the product will still be the same. Thank you!
81 Comments on “How to host your own website using WAMP Server”
I have done same things and am able to access my webpage from outside. I wish I would have find your site before. Anyways, the question is, how safe is it? Is this method prone to hackers? is it safer to use web hosting services?
Hi archana, I think implementing some of the suggestions on this post will go a long way but remember that nothing is 100% secure. I would only use this for personal projects though. I recommend using a good web host for anything that involves sensitive information, like e-commerce.
I had WAMP working great on Windows 7, decided to upgrade to Windows 10, and now I’m unable to access my server from the web. All of my ports are forwarded correctly, I have local access to my site, WAMP icon is green and online. My Domain Name is forwarded to the correct public IP address. IIS is disabled in Win10. I’ve followed so many tutorials to setup WAMP, but all of them are based on Windows 7 & 8, none are for Win10. Any ideas?
I could just go back to Win7, or run a VM with Win7 and run it from there instead.
I had not tried Win10 yet with WAMP, I am still running my setup on Windows 7. Try checking Windows Firewall and make sure you allow the WAMP services and the necessary ports. Once I upgrade I will update this post with any new info. Let me know if this helps or if you find a solution for this, I’d love to hear about it. Thanks!
Are you running wamp in compatibility mode for windows 7? it works for me
hi henry u are greate man
how i can use my website with domain name ?
really i wana everybody from outside just type my adress like http://www.test.com and see my index.htm file whitout see my ip addresss.
Hi farzad, you can definitely use your own domain name. You will need to register the domain and get Dynamic DNS service to be able to point the domain to your web server. This is the typical option for non-static IPs. A company named No-IP provides Dynamic DNS service that works great. You can check out their page for more info: http://www.noip.com/remote-access. They have a free option but you will have to use domains provided by them. Hope this helps 🙂
Thanks for the great article.
I’ve developed a wordpress site locally running wampserver, and now I want to host it temporarily for other people to view and comment before I pay for proper hosting and move it live.
Having followed all your instructions, the site is indeed accessible from the web, but unfortunately the content doesn’t work properly since all the links (and presumably media, theme etc) are all pointing at localhost/…
I’m hoping that I’ve just missed something – do you know if there is a simple way to resolve this (ideally make all the locations relative rather than absolute)?
It may be that your DB needs to be updated with your domain info. I recommend using the DB replace tool as shown on this post –> https://blog.hsnyc.co/how-to-transfer-a-live-wordpress-website-to-your-localhost-manually/. Hope this helps.
When you said : ” Save your file and go to C:\localhost\phpmyadmin ” I didn’t found any file localhost in C or D or in the wamp folder … What can I do ? Do you have any suggestion ? I followed your steps but there I couldn’t found these file ….
Never mind I made the site. But now I hove another question …. I want to put the domain name for it, but when I try to put it (from hosts and by configuring vhosts from apache), it’s not working for others to access the site …
Hi Andrei, sorry, I meant to say http://localhost/phpmyadmin. I will change this on the post. Thanks for your comment.
hi henry, i want to set up a icon if my ip is able to ping to local address it would lit to green but if its a failure it would lit to gree. please assist
Hi Pragna, I am not sure what you are trying to do. Can you elaborate a bit more..?
you have told that we can use our own domain, and i have created a host on no-ip.com. after that what should i do to make my website available on that domain. please help…
Hi Ujwal, you will need to point that host to your ip address. Then make sure that your router is forwarding any internet traffic to your web server’s ip. If you have a dynamic ip, then you will need to download the Dynamic DNS Update Client tool provided by No-IP. You can download it via their website http://www.noip.com/download. Hope this helps 🙂
I’m hosting this on an internal server here at work.
I eventually got WordPress to work somewhat. The first issue I came across was not being able to create any posts, save anything, or upload images.
Do you know what else I can do?
I have not forwarded any ports, but the page is visible within our internal network at work. I just can’t perform any tasks within WordPress when logged in.
Thanks in advance.
Interesting, I have not come across that issue. Are all the site pages visible? Have you tried other browsers? If so, I would try a re-install of WP. Not sure what can be causing it at this point.
Thanks for responding.
I’m getting an error whenever I’m trying to save anything.
Here’s the error:
POST http://exampleURL.com/wp-admin/admin-ajax.php net::ERR_CONNECTION_RESET
I’ll try to re-install.
Forgot to mention that all the site pages are visible. Something is blocking it from saving and uploading.
which one is 127.0.0.1 ???
I think the rest will be my network’s internal IP (126.96.36.199)?
make a bit elaborated?
I would like to thank you for the best ever guide on how to create webpages.
Hi Levi, 127.0.0.1 is your loopback address. The ServerName is the IP address of your server. On most home routers this is normally an internal IP that starts in 192.168.x.x. Hope this helps. Thank you for the comment 🙂
I installed the wamp on a machine working in a LAN. the internal IP of the PC is 172.2.10.x. so I think you told me to put this IP as |ServerName; so what about |Listen xx.x.xx.x: 80??? what kind of IP should I put there??? You wrote a bit confusing thing under in your article that reads [youripaddress & youipaddress].
sorry for taking your time, but I have an other question?
I want to install Joomla, and may be similar other, on my wamp server by making sub folders in the www root; I already deleted the files existed in www according to your explanations.
You said in the article that I should to write index.php as well as .htaccess to create sub folders. As you see from my questions, I am a beginner. So please prepare brief article on this issue and just try to give me and others some exemplary codes that can help beginners to prepare their own index.php and .htaccess files.
Sorry, that was a typo. I have corrected it on the article. It was meant to say ‘youripaddress’. So on both ServerName and Listen you would enter the same IP. Hope this clears the confusion.
By what name will the website go and where will I put my web address
Internally, the address is ‘localhost’ to access the root.. if using a directory for your site then this will be ‘localhost/[directory name]’. Hope this helps.
OK, I read your guide and it is one of the best that I found on this topic, nevertheless I still have problems to make it work and it is really important for me to resolve this issue asap.
So, if you have time, i would appreciate your answer.
I followed all the steps in your guide, for windows firewall, apache config, phpmyadmin conf, router setting, forwarded port to my local ip adress (on port forwarding check it says it is open) and when i type in my public ip in browser, i get ERR_EMPTY_RESPONSE (localhost works). I read somewhere that port 80 is maybe causing this, but when change it to 8080 it says ERR_CONNECTION_REFUSED (localhost also works on 8080 when i change it). I would guess that problem is with my apache settings but really don’t know what to change.
This my third day with this problem, so any help would be more then welcome! Even some direction, because i am running out with patience and ideas…
I have not dealt with this issue before but after entering this error in the all mighty Google I found many articles that suggested a fix. One of them is to open your command window (run –> CMD) and enter the following commands:
netsh int ip set dns
netsh winsock reset
See if that helps. If not try entering this error on Google and see what others suggest. The suggestion I made here is from the second article from the Google search results. I hope this helps.
After doing all this ,the apache service is not getting start.
Hi Aditya, check out the suggestions on this post –> https://blog.hsnyc.co/troubleshooting-the-orange-status-light-in-wamp-server/
Great walk through ,
had some issues with using this method on win 10 , but I was using the 3.04 snapshot of WAMP .
after going back to the 2.5 flavor of WAMP, everything installed and setup smoothly . My intentions are just to use this as a simple server to host a page for my son and his friends video game clan . Thanks for the help!
Awesome!, glad it was helpful. Thanks for the comment 🙂
hey henrgy am having a problem configuring my apache server am using version 2.4.9 i cant find the Listen 0.0.0.0:80
which file should i put this
Allow from all
am bit lost there please help thank you
Hey Collins, you would make these edits in the httpd.conf file found under C:\wamp\bin\apache\apache2.4.9\conf (on Windows of course). Hope this helps.
I’m running my database in wamp server now I added a login and register to my site. the problem is it’s not connecting to the database for registration issues. know any code? or something to sync the db?
Are you trying to sync the DB between your local and production servers?
Yes. I’m using winscp for my local server
Are you using WP?.. if so this plug-in looks useful for this – https://github.com/wp-sync-db/wp-sync-db
No not WP, just sublime and Notepad++.
Hi Henery, great article. Will this allow my friends to access my webpage too? Thanks
Henry* Typo. 15 Characters or more
Absolutely, It will be available on the internet and therefore visible to the entire world 🙂
Hello, Can we install wordpress and redirect bought domain exemple From godaddy to own machine ip adress?
Hi Marius, yes you can do this using a service like no-ip.
And if i have fix ip? i need no-ip service?
If you want a domain name to resolve to it then I believe you do need it.
I’m having a problem with my external IP not being able to connect to my web server due to a 403 error.
I tested phpmyadmin and I can access it externally when entering my information.
But all that pop ups when I go to my external IP is that error saying I don’t have permission to access it. I have a feeling it has to do with apache’s httpd.conf file. I’m running Windows 10 if that makes a difference.
Yes, this sounds like an issue with your httpd.conf file. I would give it a second look to make sure all is right.
I am from India, My Name is Sunil Pandya
I want to know that i have web domain from godaddy, i am trying to do as per your step, but i am not able to see my website if i type my web domain, i am changing virtual host in apache, also in windows, I have also with me static ip from my ISP.
I want to know i have to write 127.0.0.1 to godaddy manage domain page? or my static ip?
In Short I have web domain from registrar godaddy, i will download wamp to my laptop harddisk, this domain i want to attach wamp which i have downloaded, can you give the step by step blog?
Hi Sunil, I would enter the static IP in GoDaddy so that your domain knows where to go. Hope this helps.
HEY, HENRY, i want to add time countdown display FROM 60 minutes (00:59:59> so that if time reaches 00:00:00 the page closes and submit data filled in the form.
i’m wondering why doesn’t matter if i put wamp online or offline i can still see my webpages, please can you explain if there is a way to change that.
Great site btw.
Hi David, thats odd. The pages may be cached. I have not used wamp for over a year now. Try mamp. It is now available for Windows –> https://www.mamp.info/en/
1. I am trying to host a wordpress blog to my team in my company (max 30 people). I would add/edit my content in admin mode and the team who are in same network are supposed to see the content whenever they type the url. My current URL is
http://myip/wordpressfoldername — This gives me admin view of the site. I can edit the contents and settings
http://localhost/wordpressfoldername –Thisalso gives me same as above.Except that the landing page doesnt have site customisation options . Rest remains the same
How to proceed to host this site so that my team mates can do a read only and I can do edit/add/delete
Now When I type http://myip/wordpressfoldername from any other computer .I am getting ‘You don’t have permission to access / on this server.’ error.
2.If My goal matches with what you described here . Please tell me where in windows i need to configure the below step
“Configure Windows Firewall to allow wampmanager, port 80 and 443 “
Not sure why you get the admin panel by visiting the url you described. The default path would be yoursite/wp-admin. If you mean you are able to see the admin bar then it means you are logged in. 2. You can open the Windows Firewall by typing “Windows Firewall” in the Windows search box. It may look different based on the Windows version you are using. But basically you will want to create those two inbound rules and that should do it. It can also test by disabling the Firewall temporarily. Hope this helps.
I have a little problem here. When I do localhost:8888 it works it shows phpMyAdmin . When I do localhost:8888/wordpress it gives 404 error and it is also drops the port number so the url looks like this http://localhost/wordpress/
You should be able to omit the port number once you configure Apache to listen on port 80.
Hi sir, can we use adsense ads using wamp server or i should ask can we earn money by using our own hosting?
hello sir ,
i am running wamp server version 3 on windows 10. I did all the things you mentioned above .The server is running online showing green icon , yet i am unable to access the website using my public ip address.
It shows some 503 error. Although , i am able to access the site on my other devices , but only through LAN . I have done port forwarding also .
Thank you .
This site can’t be reached
localhost refused to connect.
When I try to access my website from another device within my LAN, I received the above error messages. Kindly help.
Many thanks, and more power to you!
Hi, hope you are able to reply, but I want to know why people from the outside can see that my website is for sale, http://mcgp.com/test.html , this is the address
Thank you so much for the article, really helped a lot. I have a question though, how can I host my website which is created on WAMP server to a given domain, and do I need to transfer the tables created in database as well? Also, do I need to transfer all the files used in the field? Kindly help me with this, thanks in advance.
hi Henry please how can i create a project folder on the wamp server root directory
Hi Catherine, on Windows you can just right-click inside the directory and select “New Folder”.
This is a great setup for wamp users.
But I still have a problem…………can i change my “localhost” domain name to something else like “project1”?
I really need this help? Please help as soon as possible?
Yes, you can change it by setting up a domain name and using a dynamic DNS service like No-IP – https://www.noip.com/
I have to ips. One is external ip and one is internal ip. So which one should I write on the Servername?
Your internal IP.
I have bought the domain skylifeinc.co.in from godaddy. How do i host it in my house using wamp?
Please email the procedure to me.
I want to do it badly.
I have made a simple database using Wamp Server. I want to link that to my website dashboard to show dynamic tables.
I tired few ways but none of them seem to work.
what would you suggest?
Should i type my domain or my ipadressin ‘youripaddress’ as you said in your article.
I appreciate your good works on this article, but I have been reading many articles on this same subject matter, and most of the articles specify that the ISPs do block port 80, in this case what is your advice for one to boycott this barrier, or is there any other way one can configure his/her server to work without permission from the ISP?
Thank you in anticipation as I await your reply please.
Hello there, i just came accross this tutorial. i was wondering if I should be doing anything on the windows system32 Hosts file under drivers.
i have a domain name, pointed the A records to my public IP address given by my ISP, did the steps above, but no matter what i get a forbidden screen. i can’t even access the sub-directories on wamp64/www/.
Hello! I followed the steps (and it worked, there were no errors) but i don’t know how to access to my website
Hi Fabio, you would use your local ip address or if accessing from outside your network you would use your external IP address (make sure port forwarding is configured).
Please i got my gateway address by typing ipconfig on cmd… But when i type in the address to my browser to set up the port forwarding, i just keep getting error msg, meanwhile other sites are going well… Wat do you suggest i do?
Hi, are you trying to reach your router to configure port forwarding? If so, here is a good article that may help – https://www.wikihow.com/Set-Up-Port-Forwarding-on-a-Router
Hi, I developed a website using php in my windows machine. I used WAMP for development. Now I want to put it to production. For hosting I tired Google Cloud. Since I was doing it in Windows, I created a Windows VM instance. My problem is I dont know how to host my domain in Google Cloud and how to setup php in that server. Since it is Windows machine, I connected it using Remote desktop and installed WAMP in it. I was trying to host the website using WAMP. But in your post I found that the WAMP is not a secure method for hosting. So then how can I host my website in a professional way in Google Cloud?
Hi Vijay, I don’t have personal experience hosting on Google Cloud but they have a webpage with a lot documentation that you can check out – I hope this helps.
Find and enter:
Allow from all
Save the file.
i got stuck here need immediate help where after www i could not get this