I Ditched Vercel for a $5 Self-Hosted Alternative

Photo by Ivan N on Unsplash

I Ditched Vercel for a $5 Self-Hosted Alternative

Deploying Next.js projects to Vercel has been the easiest way to go but after listening to so many horror stories about Vercel's vague pricing and how users get overcharged for their simple apps, it made me wanna explore other options. That's when I found out about Coolify.

Coolify is an as an open-source & self-hostable Vercel alternative which is highly cost efficient. I mean take a look at their pricing page! Just $5 for unlimited applications/databases/services per server. The only catch? You need to bring your own servers but you can do that from any cloud provider of your choice.

I decided to go with Hetzner as that, again, seemed like the simplest and most cost efficient option.

Let me take you through the steps of how you can deploy your own Next.js projects on a Hetzner server using Coolify.

  1. First things first, let’s start by getting our accounts set up on both Coolify and Hetzner.
  • After creating an account on Hetzner, go to Hetzner Cloud, Create a New Project and then Create a Server for the project. I went with all the default settings and for the Type of CPU, chose the Shared vCPU x86 option, and bought the server.

  • Next, go to Coolify and select the Cloud option. You have the option to self-host Coolify but to make things simpler, I decided to go with Coolify Cloud as it’s the easiest way to get started quickly.

    After making the payment, you should see a screen like this, click on “Skip onboarding” - this will take you to your Dashboard.

  • Go to the Keys & Tokens tab on the left panel, click on “+Add” next to Private Keys and generate a new SSH Key. Copy the Public Key that was generated, and then click Continue.

  1. Now, let’s move on to adding this public key to our server’s ~/.ssh/authorized_keys file.

    • Open your server on Hetzner and copy its IP address. On your machine terminal, to make sure the server is up and running, access it using SSH:

      ssh root@your-server-ip

      You’ll be prompted to enter your server password which would have been sent to you by Hetzner on your registered email address.

    • [Optional]: Update and secure your server by running:

      sudo apt update && sudo apt upgrade -y

    • Now, navigate to the .ssh directory:

      cd ~/.ssh/

    • Open the authorized_keys file with a text editor (e.g., nano): sudo nano authorized_keys

    • Paste the Public Key you copied earlier at the bottom of the file.

    • Save the file with Ctrl + O, press Enter, and exit with Ctrl + X.

    • Your key is now successfully added to your server.

  2. Next, we need to add this server to Coolify. Select a Name, add the IP Address (previously copied from Hetzner) and use the private key that you generated earlier. After filling in the details, click Continue. On the next screen, click Validate Server & Install Docker Engine to complete the setup.

  3. Finally, open the Projects tab on Coolify, add a new Project, click on production environment and add your public repository. For a Next.js project, Set Build Pack to nixpacks.

If everything is successful, you should see your project configuration page, where you can add all the env variables for your project and clicking on the Deploy button will finally deploy your Next.js application on Coolify.

Why This Matters

The combination of Coolify's straightforward pricing and Hetzner's affordable servers creates a compelling alternative to traditional cloud platforms. While it requires more initial setup than clicking "Deploy to Vercel," the long-term benefits in terms of cost control and infrastructure understanding make it an increasingly attractive option for budget-conscious developers and teams.

As cloud costs continue to rise, mastering these self-hosted solutions becomes an increasingly valuable skill in our technical arsenal.

(P.S: If you’re building hobby projects, I’d still recommend using Vercel for its simplicity, but for all your serious projects self-hosting should be a no brainer.)

If you liked this article, consider following me on X. I frequently share updates and lessons about building my solo MVP agency :)