Hi,
I'm a developer that has released a number of products over the years, some of which have been acquired. My most recent product is Accreditly, which is a certification platform for developers to take exams and prove their knowledge in various web technologies like PHP, JavaScript, Database Design and WordPress. We have a few more certifications coming too.
My post here was triggered by a comment thread I read on a fairly popular post here on Indie Hackers about how it isn't possible to host a WordPress website for less than $20. That is, of course, not true, in fact I successfully ran one of my SaaS products which ran a large number of background tasks and spidered a number of customer websites on infrastructure that cost under $10 per month.
Below I'll talk you through the tools you can use to host any website for very little money (<$5/month in most instances), whilst giving maximum flexibility to customise anything you want, and the ability to scale as your product grows. None of these solutions will shoehorn you into a slow or unreliable solution, and none of them will use proprietary tech that leads to vendor lock-in.
For what it's worth, I link to a lot of websites in this post and I don't receive any affiliate commission from any of them (you'd see some sort of affiliate tracking in the URL if I did). These are my genuine recommendations.
OK, so this post doesn't need you to be a developer, but it does expect you to know the basics. You're going to need the following to host any kind of website, whether it's a WordPress blog like the original IH post suggested, a brochure site for your project, or your own SaaS product:
We're going to be hosting a website so it stands to reason we need a web server. The web server has a number of uses and is probably the most complex item to understand in the whole list.
Some must-haves for the web server in order for it to be scalable and flexible enough for us:
We're going to want to install either nginx or apache for the actual web server. If you're building a SaaS product you're probably going to need the ability to schedule tasks via a cron too, hence why SSH access is so important. If you don't know what nginx or apache is then don't worry too much, as our deployment options can take care of it for you.
Below are the options I would recommend for the web server, in the order of preference.
DO is a great option. They offer a number of different options in terms of server size (known as droplets).
The entry level droplet is 512mb RAM, with a 10GB SSD, coming in at $4/mo. This is actually plenty to run a web server that hosts something basic like WordPress, a static site, or even a basic SaaS product.
For $6/mo you can double all of the resources on the server.
Remember, we're ONLY hosting your code on the server, we're NOT hosting the database there, which is usually the most intensive process on the server.
Your first 60 days is also free (well, you get $250 credit) with DO.
AWS is expensive when compared to many other cloud providers. They do, however, have a free tier, which gives you 750 hours a month of free EC2 time on a t3.micro, which is a 1GB server.
Pretty good for nothing! Just be aware of scaling, as you will pay more for the same server with AWS than you would with other providers, although it's still much cheaper than buying a dedicated server!
Scaleway is a similar price level to DO, but their lowest available server is 2GB RAM, meaning the price is a little higher at 10eur/mo (you pay per hour, so the actual price fluctates month to month).
Scaleway have a lot of products and their control panel has a lot of options. It's a true cloud provider, so you'll need to also pay for things like IP allocation, although that's very cheap and taken care of for you.
Scaleway also offer what they call 'Stardust' servers, which are shared CPU instances that are ridiculously cheap at around €0.073/mo (yeah you read that right, 7 cents per month!). You wouldn't want to host a website on one of these but if you were running a SaaS application with background processes these could fairly easily be put to work for that.
OVHCloud offer a 2GB instance type at under £5 a month. There are a lot of instance types available, so plenty of room to grow. You also get £175 free credit for the first month.
The database is usually the most intensive part of hosting an application. Removing it from the webserver means you're not sapping all of the resources, but it also allows you to scale horizontally (adding multiple web servers, rather than making one server more powerful).
Database as a service (DaaS) has become more popular recently, and a lot of cloud providers offer it, although not all of them offer it particularly cheaply.
Below are the options available for free, or near free, for hosted managed databases. It's in order of preferences.
Planetscale offer 5GB storage, 1 billion reads and 10 million writes per month, for free. I don't know of a better offer than that.
On top of that, Planetscale has a few nicities such as support for branches, where you can make database changes in a version-control format. It's fast too.
The paid tier is $29/mo, which is still cheap for a managed database service.
AWS RDS is Amazon's offering. It's not cheap, and the exact price you'll pay is nearly impossible to accurately estimate due to how it's charged. However, a low estimate is about $80/month.
AWS RDS does have a free tier though, but only for the first year. If you're launching a product this is potentially OK, because you should be in a position to comfortably pay for it after 12 months, but it's obviously a very expensive option if you're just hosting a small blog!
Be aware though, that with RDS you will be placed on slow instances with low I/O unless you pay for a certain tier. It's a little bit of a minefield.
DO again. They offer a managed database product which comes in at $15/mo. You can scale up easily in their control panel.
DO is way easier to manage than RDS but no free tier unfortunately.
You'll need a way of managing DNS and you'll probably want a WAF (web application firewall). I wouldn't recommend just sticking with your domain registrar's nameservers because they're probably exposing your server's IP address and won't offer much customisation.
Only one option here, not sure of anything else offering this service.
Cloudflare is just a superb tool. It's free, forever, with no catches. For that you get so, so, so much:
Honestly, you'd need a compelling reason to not use Cloudflare in my opinion.
Sign up is pretty easy, just register for an account, point your nameservers at the ones they give you, and then add you server IP in.
You may not know what this is, in which case you probably don't need it. A CI pipeline is a way for you to run various development tasks as part of your deployment. It's often separate to your deployment tool and does tasks such as running tests or compiling assets within the project, and then instigates a deployment if tests pass.
Lots of options in this space, but my go to recently has become GitHub Actions. I won't labour the pros and cons of these in this post as it's probably a bit out of scope of this site, but happy to answer any questions.
Pretty great tool, just throw a YAML file in your project and it will do whatever you need. You get 2,000 CI/CD minutes free with a free account. That's enough for about 3,000 runs of a Laravel project with a few dozen tests and a large npm asset compilation.
CircleCI has a free tier, with 6,000 free minutes. It's also possible to parallel your tests to run faster. CircleCI is a bit more involved that GitHub Actions but it does way more.
ChipperCI is Laravel only, but has a free tier. Probably enough for a small project.
OK so you have all of the tools, now what?
You might have the knowledge to configure your server, in which case great, just take your SSH keys and get going. But if you aren't such what to do with a terminal then there are options available to you.
A few options here, the top being my go-to.
Ploi has a free tier. Give it your Digital Ocean API key, or SSH access to your server and it will apply its image to your server.
From within Ploi you can do everything from:
And tons more. It's a great tool. If you do outgrow it the next tier is only €8 /mo, which should be plenty.
Forge is a Laravel project, however you can do more than just deploy Laravel apps to it.
Forge is similar to Ploi, give it your API key for the various options and it will create and manage your server for you. Everything Ploi does is covered in Forge, but Forge has some added Laravel nicities.
ServerPilot isn't free, but it's pretty cheap at just $5/month. Personally I would pay a little more and get a paid Ploi sub if you were considering this, but it's an option.
Conclusion
There's a lot said in this post, so apologies if it's difficult to take it all in, but hopefully it's been useful.
Using my preferred tools from each category below is an illustrative example of how much you could run a server for capable of hosting a blog, brochure site, or even a small SaaS product. Remember that all options are scalable, so if you were going down the SaaS product route and it suddenly gains popularity then it's very easy to upgrade services to cope.
Any questions please comment or drop me a message, happy to help!
Your post seems very informative. However, I see this topic differently. Yes, I noticed that businesses want to host both frontend and backend at the same time. In my opinion, companies can also select distinct platforms to host their client side and backend.
Likewise, dev teams can benefit from AWS Container Service to deploy frontend of their applications and go with options like Supabase or Firebase to host server instances. Correspondingly, this guide https://blog.back4app.com/how-to-host-frontend-and-backend/ is a must-read thing for you if you are looking for a single place to deploy server data and frontend.
Indeed, I am referring to two prominent products of Back4app: Container Service and BaaS. This open-source cloud computing platform can help you deploy the app seamlessly. I believe you need to include this option in your list.
Similarly, Microsoft Azure, AWS Amplify, Parse and Nhost are also reliable platforms for host applications with great scalability.