How I Deployed My NGold Netflix Clone on AWS EC2 with Docker Compose


For over five days, I didn't publish a new article on Sirvivk DevOps Dairy.

It wasn't because I had run out of things to learn or document. Google Search Console had reported nine redirect errors affecting URLs on my blog, and honestly, it was discouraging.

I had spent time documenting my DevOps learning journey, so seeing those errors made me concerned about whether my articles were being indexed properly. I spent time checking reports, testing URLs, and trying to understand what was happening.

But I didn't stop working on my projects.

Behind the scenes, I continued learning, troubleshooting Linux commands, working with Docker containers, and deploying my NGold Netflix clone to an AWS EC2 instance.

In this post, I'll document what I did, the command-line mistake I encountered, and what I learned while working with a small EC2 instance.

1. Introducing NGold: My Netflix Clone Project

NGold is a Netflix-style web application that I deployed to an AWS EC2 instance. The deployment uses separate frontend and backend containers managed with Docker Compose.

Here is a summary of the environment I worked with:

  • Cloud provider: Amazon Web Services (AWS)
  • Compute service: Amazon EC2
  • Operating system: Ubuntu Linux
  • Container technology: Docker
  • Container orchestration: Docker Compose
  • Frontend image: sirvickcloud95/netflix-frontend:latest
  • Backend image: sirvickcloud95/netflix-backend:latest
  • Frontend port: 3000
  • Backend port mapping: Host port 5000 to container port 8080

The EC2 instance's public IP address was 32.196.145.76, and I accessed the frontend using port 3000.

My goal was to get the application running, understand how the containers communicated with the host environment, and document the experience for future reference.

2. My First Mistake: The "cd: Too Many Arguments" Error

While working in MobaXterm, I attempted to navigate to my project directory and append a swap configuration entry to the Linux filesystem table.

Unfortunately, I combined the commands incorrectly. The terminal returned this error:

-bash: cd: too many arguments

The problem was that I had placed the directory-navigation command and the text I wanted to write into the configuration file on the same command line without separating the operations correctly.

It was a simple mistake, but it interrupted my workflow.

I corrected the process by separating the commands. First, I navigated to my home directory:

cd ~

Then I ran the command to append the swap configuration entry:

echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

The terminal displayed the entry I had written:

/swapfile none swap sw 0 0

This confirmed that the text had been appended to /etc/fstab.

However, there is an important distinction: this command does not create or activate a swap file. It adds an entry that can help Linux enable an existing, correctly configured swap file during startup.

Before relying on that entry, the swap file must exist, be configured correctly, and be activated as required.

My lesson: When working in Linux, understand what each command does instead of simply copying commands from a tutorial. If an error occurs, read the error message, identify the problem, and correct it before proceeding.


MobaXterm terminal showing bash cd too many arguments error fix and Docker containers ubuntu-frontend-1 and ubuntu-backend-1 starting on AWS EC2 instance 32.196.145.76 with 0.89GB RAM

 Fig 1: MobaXterm showing the cd error and Docker containers starting on 32.196.145.76


3. Why I Paid Attention to Memory on My EC2 Instance

One detail visible in my MobaXterm screenshot is the instance's limited memory. At the time of the screenshot, the status bar showed approximately 0.89 GB of RAM, with about 0.52 GB in use.

When working with a small cloud instance, memory management matters. Docker images, application processes, and other running services all compete for the available resources.

A Docker build or an application starting several services can create additional memory pressure. If the system cannot meet its memory requirements, processes may fail or the Linux kernel may terminate processes to protect the system.

This is why I was working on swap configuration.

Swap allows Linux to use disk space as part of its memory-management system. It can help when physical RAM is under pressure, although disk-based swap is much slower than RAM and does not replace having sufficient memory for an application's workload.

There is also an important distinction between creating a swap file and making it persistent. The swap file must first be created and enabled. An appropriate entry in /etc/fstab can then help ensure that it is enabled again after a reboot.

This experience reminded me that deploying an application is not only about getting containers to start. I also need to understand the resources available to the server and how the operating system manages them.

4. Starting the Frontend and Backend with Docker Compose

After working through the commands, I checked the Docker Compose output.

The terminal showed that the default Docker network had been created and that both containers had started successfully.

[+] Running 3/3
 ✔ Network ubuntu_default Created
 ✔ Container ubuntu-backend-1 Started
 ✔ Container ubuntu-frontend-1 Started

I also checked the running containers and their port mappings.

The frontend container used this image:

sirvickcloud95/netflix-frontend:latest

Its port mapping was:

0.0.0.0:3000->3000/tcp

The backend container used this image:

sirvickcloud95/netflix-backend:latest

Its port mapping was:

0.0.0.0:5000->8080/tcp

In simple terms, traffic reaching the EC2 instance on host port 3000 was forwarded to port 3000 inside the frontend container. Traffic reaching host port 5000 was forwarded to port 8080 inside the backend container.

The terminal reported both containers as running. That was an important step, but it did not automatically prove that every application feature was working correctly.

I also needed to inspect the application through the browser to confirm that the frontend was accessible.

This is a distinction worth remembering: a container showing a running status does not automatically prove that the application is healthy or that its frontend and backend are communicating correctly.

5. From the Terminal to the Browser

After checking the containers, I opened the application through the browser using the EC2 instance's public IP address and frontend port.

The application homepage displayed the NGold interface, including the M3GAN trailer area and the Login and Register buttons.


NGold Netflix clone homepage deployed on AWS EC2 port 3000 showing M3GAN movie trailer, login and register buttons, commit to GitHub repository Sirvickcloud91 netflix-frontend-1

Fig 2: NGold homepage live on EC2 port 3000 showing M3GAN trailer


Documenting the deployment matters to me because I want my projects to be more than applications that happen to be running. I want to keep a record of what I built, the tools I used, and the lessons I learned along the way.

A screenshot does not tell the entire technical story, but it provides a useful visual reference alongside terminal output and project documentation.

6. What This Deployment Taught Me

This project reinforced several lessons I want to carry into my next deployments.

Small mistakes can interrupt an otherwise straightforward task

My command-line error was not a complicated Linux problem. I had combined commands incorrectly. Taking a moment to understand the error was more useful than repeatedly running the same command.

Cloud resources have limits

Working with limited RAM made me pay closer attention to memory consumption and the role of swap. Choosing an instance size should take the application's actual requirements into account.

Running containers and working applications are not the same thing

Docker Compose successfully started the frontend and backend containers. Checking the application through the browser provided another layer of validation. More thorough testing would still be necessary to confirm features such as authentication and backend connectivity.

Documentation is part of the learning process

By recording terminal output, screenshots, commands, and mistakes, I create something I can revisit when I encounter a similar problem in the future.

This is one reason I continue documenting my DevOps journey. I am not claiming to know everything. I am building my understanding through practice, troubleshooting, and continuous learning.

7. Five Days Away from Publishing Did Not Mean Five Days Without Progress

My temporary break from publishing reminded me that visible activity and actual progress are not always the same thing.

Sometimes, we become so concerned about producing something new that we forget the importance of the work happening behind the scenes.

In my case, Google Search Console's redirect errors were discouraging. I still need to resolve the indexing issues, and deploying NGold did not fix those errors. They are separate technical problems that require separate solutions.

However, the setback did not mean that my entire learning journey had to stop.

I continued working on my projects, learning from mistakes, and documenting what I could.

That is one lesson I keep returning to: consistency does not mean that everything goes according to plan. It means continuing to make meaningful progress, even when the original plan needs to change.

Not every day will produce a breakthrough. Not every deployment will be smooth. Not every article will be published on schedule.

But every problem we investigate, every mistake we understand, and every skill we practise can contribute to our growth.

8. Connecting This Project to My Other AWS Deployment

NGold is not the only project through which I have been learning about cloud infrastructure.

In another hands-on project, I explored a different approach to hosting a website on AWS. That project involved EC2 web servers, NGINX, an Application Load Balancer, an Auto Scaling group, Amazon EFS, and other networking components.

While the NGold deployment helped me practise containerising an application and running its frontend and backend with Docker Compose, the other project gave me an opportunity to explore how multiple web servers and AWS services can work together to support a more resilient hosting environment.

You can read the full walkthrough here:

Related article: How I Built a Highly Available Website on AWS Using EC2, NGINX, ALB, Auto Scaling and EFS.

Both projects have helped me appreciate that cloud deployment involves more than making an application accessible. It also requires understanding networking, resource management, application health, and the relationships between infrastructure components.

Each project teaches me something different, and documenting those lessons helps me build on what I have already learned.

Conclusion

NGold is another step in my hands-on learning journey. I deployed its frontend and backend containers on AWS EC2 using Docker Compose, worked through a Linux command error, explored swap configuration, and documented the application's interface on GitHub.

I still have more to learn about Linux administration, container management, cloud infrastructure, application testing, and production deployment. That is part of the process.

My Google Search Console indexing issue remains a separate challenge, but it has reminded me not to measure all my progress by a single report or setback.

DevOps is not only about seeing a successful deployment message. It is also about understanding what happened, investigating what went wrong, checking the result, and learning enough to make the next attempt better.

The redirect errors may have interrupted my publishing schedule, but they did not end my learning journey.

NGold is another project documented. Another lesson learned. Another step forward.

Still learning. Still building. Still improving.

Thank you for reading SirVick DevOps Diary. If you are also learning Linux, Docker, AWS, or DevOps, I hope my practical experiences help you with your own journey.

Comments

Popular posts from this blog

How I Fixed GitHub Error: failed to push some refs to github.com in 2026

How I Deployed Netflix Clone (NGold) to AWS EC2 - Live at 32.196.145.76:3000 [Docker + Nginx Guide]

Understanding Linux Environment — The Real Engine Behind My AWS Cloud Deployment