WordPress self-hosted

How to set up WordPress self-hosted on a small budget

It is 2024; we have many options for setting up a website/blog, but WordPress self-hosted is still suitable for those who want total control over the content.

This article will cover how I configured this very own website and the costs involved in it.


Cost summary

Total cost per month:$5.32
Total cost per year:$63.88

*You can lower costs by getting a good domain registration and hosting deal. I’m using standard values for simplicity.


Domain name

The first thing I did was to register a domain name; since I already have other domains registered at Namecheap, I will go with it, but you can pick any registration service you want.

They always have deals, and you can get a domain for less than $10/year, but I chose to use the standard value here to make it simple.

Web Hosting

Again, I’m picking DigitalOcean since I’m used to it, but you can pick any cloud server you like.

I’m paying $4/month for a 512MB RAM Droplet, which is enough for my starting needs.

I configured the WordPress application and the database inside the same Droplet (VM), so the cost will be the same.

Ubuntu 22.04 was the Linux distribution picked, then manually installed and configured PHP, MySQL, Nginx, WordPress, and Let’s Encrypt for HTTPS/SSL.

I have solid experience with DevOps work and cloud services management in general, but anyone comfortable with Linux and command-line tools can handle it.

External comment system

The comment system inside WordPress is not bad, but it requires more processing power and more data storage; the goal was to keep it on a budget, so I decided to use an external system.

On top of that, an external system can take care of spam, so delegating it is a wise choice if you don’t want to be moderating spam.

Disqus was my choice for no reason other than being the only one I know who does this service, and it can be free. There are paid plans, but the free plan is enough for a simple personal website.

It usually works smoothly via plugin; in my case, I’m using the most recent theme from WordPress, the Twenty Twenty-Four theme, and this is not working out of the box with the Disqus plugin, so I had to make it work manually via Universal code option and disable the plugin. For other themes, it may work without a problem.

Media hosting and delivering

In a WordPress self-hosted site, the media files may consume lots of storage space, and depending on your hosting service, it can also weigh in the data transfer limits.

With that in mind, I decided to host all the media in AWS S3 buckets and serve the media files via CDN with AWS CloudFront.

Uploading the files to S3 will help me keep the website server light; no images, documents, videos, or any media files uploaded to this WordPress instance will live in the same server, going directly to an S3 bucket in the AWS servers.

Regarding delivering the media files, I configured a CDN layer with CloudFront to show these in the people’s browsers instead of loading from S3 directly.

That way, the media loading time will be improved since CDN services deliver the file from a nearby server to the browser requesting it.

I can also use my domain to deliver the files; CloudFront also provides that option.

It sounds complex, and it is 😄, but I made a draw to help understand it.

WordPress self-hosted working with AWS

When I described as “almost free” in the summary above, this is what I meant:

The final cost may vary according to your storage and data transfer volume, but it will have a meager price for a personal and small website/blog.

SMTP service

The WordPress system needs to send emails, and a WordPress self-hosted is no different, so a way to send email messages is required. You can use your Gmail account because it is supported, but I recommend using an SMTP service for transitional emails.

There are many options for SMTP vendors; I will pick Mailgun since I already have an account there, and it works perfectly.

Furthermore, it is free to send less than 1,000 emails monthly.

It also has a plugin that makes it easy to configure.

Site Analytics

There is no surprise here, only the well-known and free Google Analytics.

It seems there are simpler and fancy services now, but I decided to go safe with things I’m used to.

Caching system

To keep my website on a budget, caching is essential since I’m using a very low-cost server instance; the plugin W3 Total Cache allows me to cache pages as static files on disk, which means that instead of load data from the database and building the page everytime a visitor requests it, the caching system loads it the first time and saves it to disk.

Next time a visitor requests the same page, it will be delivered directly from a static file on disk, lightening the database load and server processing.

WordPress self-hosted working with cache

As you can see in the graphic above, the cache skips the PHP, the WordPress, and the database; the Nginx serves it directly from the static file.

When you edit a page that is already cached, it clears the cache automatically, so the process restarts.

You can also clean the cache manually via the admin panel.

Search system

This is an improvement I made after the first setup; I replaced the WordPress built-in system for search with the Google Programmable Search Engine.

With that, I can improve security and performance moving forward.

The ultimate WordPress self-hosted

In conclusion, it is a lot of work, but if you have the knowledge and the time to accomplish it, why not?

It took me a week, using my spare time, to research the best tools to pick, not more than an hour per day.

And an entire afternoon to make it on a Sunday.

The result is a reliable system that I can use for years until a significant upgrade is needed.

And the best thing for whom is looking to self-host a website is that the entire content is under my control.

If you want to do the same with your website or have any questions about this content, drop a comment below or ping me on Twitter/X at @renatonitta.

Comments