If you want to cut out third-party hosting providers, it’s worth considering how to host your own website and running your own server.
Whether this is the first time you’re hosting a site or you’re a seasoned pro, hosting your own website can be a daunting task. Thankfully there are a lot of options and we’re going to show you how you can put them into practice.
Hosting your own website isn’t just about getting a server set up – you’ll have to consider the cost of electricity, access to the right amount of bandwidth, and whether you want to host your website on a Windows or Linux machine.
If you’re not sure whether hosting your own website is right for you, let’s take a look at the hosting options that are right here in front of you before we begin. If you have your heart set on hosting your own website, use our contents below to navigate to hosting your own server. Let’s begin!
Table of Contents
The Benefits Of Purchasing Web Hosting
If you’re not quite ready to host your own website at home or locally, you can purchase your hosting through a hosting provider. We have lots of recommended web hosts that we’ve personally tried and tested, so you won’t have trouble locating the best hosting for your needs.
Shared hosting is often where people start; it offers affordable web hosting with enough features and benefits to get you on the right track. Many web hosts will include a free domain, SSL certificate, and even email accounts so you have the entire package to setup your website.
Alternatively, if creating a website seems like too much pressure, you can start by using a drag and drop website builder like Wix. There are pre-made templates to get you started which are all mobile friendly! All you’ll need to do is input your own content and customize your site the way you want it to look. Many website builders like SquareSpace can even help you with your SEO so your website can be found on search engines.
Best Cheap Hosting (Our Recommendations)
If you’re on a budget, finding the best cheap web hosting can be a saving grace. Some of our best recommended cheap hosting companies start from a mere $0.99 per month which could save you a lot of money, and hassle.
Although cheap hosting doesn’t necessarily sound like it’s going to offer much, we don’t recommend any hosts unless they have a good reputation. Even the cheapest web hosts still offer uptime and money-back guarantees, as well as 24/7 support, and freebies like domains, CDNs, and specialized WordPress hosting.
Best VPS Hosting (For More Control)
VPS hosting is the next logical step up from shared hosting if you’ve outgrown your hosting plan. VPS hosting offers much more scalability and more powerful servers for larger websites. You’ll have more control over your server too, sharing space with fewer customers, with allocated resources.
You can expect to pay a little more for VPS hosting in comparison to shared hosting, however, if your budget is still stretched we have some recommendations for the best cheap VPS hosting to keep things within your reach.
How To Host Your Own Windows Server
You can use your own personal computer at home with Windows to host your own website. Linux tends to be the popular choice for server hosting, with just one-third of all websites. For developers who prefer ASP.NET and C programming, Windows is a fine option. Here’s how to get started.
1. WAMP Installation
My recommendation for hosting your own Windows server is to get started with WAMP installation software. WampServer is a solid choice which I have a lot of experience with. You can download the 32-bit or 64-bit version for free here.
Follow the on-screen instructions to install and launch WampServer. Once you’ve installed WampServer a new www directory will be created on your PC, most likely under c://wampwww
In this directory you can create sub directories, also known as projects. Any HTML or PHP files can live in these sub directories.
2. Create a HTML Page
To test the server you’ll need to create an example file to put into the www directory. You can call this file info.php and use the following sample code: [crayon-5f16fe2ce2c5e410305028-i/] – save the file in the www directory which you can access from the WampServer menu.
If you input the following URL into your web browser you can see the details of your PHP installation: http://localhost/info.php
Of course, you can create any HTML or PHP file you want as you go on. In the menu options, select phpMyAdmin to start configuring your MySQL databases. A new browser window will open with a username (the default will be root).
3. Make Your Site Public
The Apache configuration in WampServer is defaulted to deny any incoming HTTP connections. You’ll need to change the Apache configuration file to make your site public.
Go to the WampServer menu, click Apache, and select the httpd.conf file to edit it. Find the following code: [crayon-5f16fe2ce2c65493528231/] and replace it with: [crayon-5f16fe2ce2c67107997480/]
Back in the menu, select Restart All Services to restart the WampServer services. Your site should now be accessible by anyone other than your localhost.
4. How To Use Your Domain
To connect your domain name to your WAMP installation you’ll need to configure some files. Add the following code: [crayon-5f16fe2ce2c69843481718-i/] to the following file: C:Windowssystem32driversetchosts
Navigate back to the httpd.conf file to add a virtual host. Search for Virtual Hosts and uncomment the line after it. Create a file in your chosen text editor (e.g. Notepad) and add the following code: [crayon-5f16fe2ce2c6c716644912/] – this needs to be saved in the following directory: C:wampbinapacheApache-VERSIONconfextra (note that the VERSION is your Apache version).
Again, Restart All Services to save and activate the changes you’ve just made. You should check that your site is accessible by entering the domain name.
How To Host Your Own Linux Server
Linux systems are the most common way to configure a server. You can set up Apache, PHP, and MySQL using LAMP stacks, but there are alternatives if you wish to explore them.
1. Install LAMP Software Using The Terminal
Open the terminal and enter the following to start your LAMP software installation process: [crayon-5f16fe2ce2c6d049361186/]
You will be asked to enter a password for the MySQL root use during the installation process. To ensure everything has installed correctly, restart the Apache webserver. If you change the global configuration of Apache, ensure you execute the following command: [crayon-5f16fe2ce2c6f396824107/]
To see which PHP modules are available and to check whether they are working, you can put a test PHP file in the webserver root directory located at (/var/www/html/): [crayon-5f16fe2ce2c71112806860/]
Navigate to http://localhost/info.php to ensure the PHP page is working. The current PHP version, configuration, and installed modules should be displayed.
3. MySQL Installation
Open up the terminal again and enter the following: [crayon-5f16fe2ce2c74236465434-i/] this will tell you if your MySQL installation is working correctly.
If you need to restart the MySQL server, type in: [crayon-5f16fe2ce2c77516902940-i/]
In order to use the MySQL command line to manage your databases, you’ll need to enter the admin credentials you entered in step 1. You can get to the login prompt by typing: [crayon-5f16fe2ce2c79347115924-i/]
Content Management Systems (CMS) like WordPress and Joomla all use MySQL databases. In most cases, the MySQL databases will automatically be created by the CMS, but if you need to manage your databases manually, PHPMyAdmin is the most user-friendly tool to use.
Now you can configure the following file: /etc/phpmyadmin/config.inc.php
4. Configure DNS
To configure your own domain name, you’ll need to accept requests for your domain by configuring Apache. You’ll need to check that your domain’s DNS has an A record, pointing to a specific IP address. If you’re not sure on how to access these details you can speak to your domain registrar or domain host to set up your DNS records.
Using the dig tool you should be able to see the A record request for your domain by typing: [crayon-5f16fe2ce2c7c949918292/]
5. Configure Apache
To configure Apache to allow web requests for your domain, you need to set up a directory for your domain and create an example index.html file: [crayon-5f16fe2ce2c7f479804099/]
To set up a Virtual Host file for Apache for your domain, enter the following: [crayon-5f16fe2ce2c81205699758/] [crayon-5f16fe2ce2c83100895169/]. Edit the file: [crayon-5f16fe2ce2c84678349316/] and reload Apache: [crayon-5f16fe2ce2c86230425305/]
Add a line with your IP address and domain name by editing your local /etc/hosts file. Change the IP address to match the IP address of your domain: [crayon-5f16fe2ce2c87407120475/]
The Pros And Cons Of Hosting Your Own Website
It’s entirely possible to host your own website at home, but is it actually practical or a benefit to do so? I’ve listed the pros and cons of hosting your own website so you can assess whether it’s really worth your time and effort.
- An educational experience and fun to do
- You have control over your own server
- You can make any system changes you want
- It’s a good path to take if you’re keen on learning about programming
- In comparison to a hosting company, you may experience a very slow connection
- It costs a lot of electricity to host your server as your computer needs to always be on
- You are responsible for any hardware and software maintenance and issues
There’s no doubt that learning how to host your own website can be a fun challenge. If you’re into the geeky side of servers then it’s a great tool to add to your belt. However, for most people, the practice of hosting your own server is quite impractical. You’ll need a lot of time, space, and money to set up and host your own server.
If all you want to do is host your website with good speeds and decent performance, there are plenty of web hosts out there that can cater to your needs. If your website starts to grow and increased traffic starts putting a strain on resources, you can look at other options like cloud hosting which is far more scalable.
To host your own website, you’ll need the drive and determination to do it. My recommendation would be to find the best web host for your requirements and go from there, especially if this is your first time hosting a website.