DEV Community

Dipu Raj
Dipu Raj

Posted on • Originally published at Medium

Deploying a Node.js Application on AWS EC2 with Apache

Deploying a Node.js application to a server can feel daunting if you're just getting started with infrastructure. While managed services like Heroku or AWS Elastic Beanstalk exist, sometimes you want full control over your setup — especially if you're hosting multiple apps on the same machine.

In this guide, I'll walk you through how I deployed a Node.js web app to an AWS EC2 instance, kept it running reliably, and served it through Apache as a reverse proxy.

📌 This approach is still valid, but some tools and versions have evolved. I’ve updated commands to use modern Node versions.


🧱 What We’ll Do

We’ll break the deployment into three phases:

  1. Install Node.js & set up the app
  2. Keep the app running with a process manager
  3. Configure Apache as a reverse proxy

🚀 Step 1: Install Node.js & Upload Your App

SSH into your EC2 instance:


bash
ssh ubuntu@your.ec2.ip.address
Enter fullscreen mode Exit fullscreen mode

Top comments (0)