cicd
16 May 2026
8 MIN READ

GitHub Actions CI/CD for NestJS: Deploy to EC2 with Docker (Free)

Most developers deploy side projects manually — SSH in, pull code, restart, hope nothing breaks. Here's how to automate the entire process with GitHub Actions and deploy to EC2 on every push to main.

Building something like this? Hire me to build your backend — NestJS, Node.js, PostgreSQL & Redis, shipped production-ready.

Mentioned Technologies

#cicd#githubactions#devops#nestjs#nodejs#docker#aws#backend

Frequently Asked Questions

Yes. GitHub Actions has a generous free tier that is enough to run tests, build Docker images, and deploy small-to-medium NestJS apps at no cost.

The workflow builds a Docker image on push, connects to the EC2 instance over SSH, pulls or transfers the image, and restarts the container, automated on every commit.

Docker is not strictly required, but it makes deployments reproducible and avoids environment drift between local, CI, and the EC2 server.

Related Reading

Need this built right?

I'm a freelance NestJS & Node.js backend developer. Let's ship your MVP or SaaS.

Hire Me

Ready for more?

Explore other insights in the gallery.

Browse All Posts