DEV Community

Cover image for GitLab CI/CD Pipeline for Django/Node Application Deployment on AWS EC2
On-cloud7
On-cloud7

Posted on

1 1 1 1 1

GitLab CI/CD Pipeline for Django/Node Application Deployment on AWS EC2

what is gitlab?
GitLab is a web-based DevOps platform that provides a complete CI/CD (Continuous Integration/Continuous Deployment) pipeline along with Git repository management, issue tracking, and security features. It enables developers to collaborate, automate workflows, and deploy applications efficiently.

Key Features of GitLab:

1. Version Control: Git-based repository management, similar to GitHub and Bitbucket.
2. CI/CD Integration: Built-in Continuous Integration & Continuous Deployment (CI/CD) pipelines.
3. Issue Tracking & Project Management: Helps teams manage work using boards, milestones, and issue tracking.
4. Security & Compliance: Offers code quality checks, security scanning, and compliance features.
5. Container Registry: Built-in Docker container registry for managing images.
6. Self-Hosted or Cloud-Based: Available as GitLab.com (cloud-hosted) or GitLab Self-Managed (on-premises installation).
7. Infrastructure as Code: Supports Kubernetes, Terraform, and Infrastructure as Code (IaC).
8. Monitoring & Logging: Provides built-in monitoring via Prometheus.

Tools Required:

1. GitLab: For repository hosting and CI/CD pipeline.
2. Docker: For containerizing the Django/Node application.
3. AWS EC2: For hosting the deployed application.
4. Django or Node.js: Depending on the chosen stack for the
application development.
5. Any code editor (like Visual Studio Code, Atom, etc.)

Step 1: Setup an AWS EC2 Instance

  1. Launch an Ubuntu 22.04 EC2 instance
  2. Allow ports 22, 80, 443 in security groups
  3. SSH into

*Step 2: Open GitLab and add a new project *

  1. Open Gitlab.com & set up the account

Image description

  1. add new project
  2. Import the project

Image description

  1. Click on Repository by URL

Image description

Image description

Image description

Step3: Create .gitlab-ci.yml file
1.Create a new file

Image description

  1. Name the file .gitlab-ci.yml file

Image description

*Step4: Run the pipeline *
1.Go to main project & click on pipeline

Image description

  1. pipeline is pending

  2. Go to the setting ,click on CI/CD and go to the runner

Image description

Image description

  1. Enable the Runner

Image description

Image description

Step5:Setup Docker & Docker Compose

Image description

  1. install Docker

Image description

Image description

Image description

Image description

Image description

Image description

Step 6: Add port to the Security group

Image description

Image description

Quadratic AI

Quadratic AI – The Spreadsheet with AI, Code, and Connections

  • AI-Powered Insights: Ask questions in plain English and get instant visualizations
  • Multi-Language Support: Seamlessly switch between Python, SQL, and JavaScript in one workspace
  • Zero Setup Required: Connect to databases or drag-and-drop files straight from your browser
  • Live Collaboration: Work together in real-time, no matter where your team is located
  • Beyond Formulas: Tackle complex analysis that traditional spreadsheets can't handle

Get started for free.

Watch The Demo 📊✨

Top comments (0)

PulumiUP 2025 image

From Infra to Platforms: PulumiUP 2025 Panel

Don’t miss the expert panel at PulumiUP 2025 on May 6. Learn how teams are evolving from infrastructure engineering to platform engineering—faster, more secure, and at scale.

Save Your Spot

👋 Kindness is contagious

Dive into this insightful write-up, celebrated within the collaborative DEV Community. Developers at any stage are invited to contribute and elevate our shared skills.

A simple "thank you" can boost someone’s spirits—leave your kudos in the comments!

On DEV, exchanging ideas fuels progress and deepens our connections. If this post helped you, a brief note of thanks goes a long way.

Okay