Vercel
For the easiest deployment, you can use Vercel. You may need to create a database using Vercel Postgres for your app. Here's how you can deploy your app:
- Add a new project and import from your GitHub repository.
- Set up the environment variables in the project settings.
- Then, deploy your app. Vercel will automatically build and deploy your app every time you push it to your repository. Done.
Self-Hosting
An easy way to self-host is to use PM2 as the process manager and reverse proxy with Nginx. The recommended machine specifications if you want to sleep well are:
- 2 vCPU
- 2 GiB RAM
- 10 GiB SSD
- Ubuntu 24.04 AMD64
If you're using AWS, you can create a t3.small
EC2 instance. Follow these steps to deploy your app:
-
Initialize the necessary packages by running the following script:
bash
-
Clone the repository, install the dependencies, and set up your project (e.g., database, environment variables, etc.).
-
Build the app & start the app with PM2:
bash
-
Set up Nginx
Create a file named
/etc/nginx/sites-available/app.conf
with the following content: (replaceexample.com
with your domain)nginx
Create a symbolic link to the
sites-enabled
directory:bash
Then, restart Nginx:
bash
-
Update your DNS records to point to your server's IP address. Then, set up SSL with Certbot:
bash
Fill in the required information and you're done! 🎉