Remote Access to Dockerized Apps in Cloud9 on a Private Subnet

Aravind
2 min readJul 14, 2023
Photo by Tim Mossholder on Unsplash

Problem

You have the following:

  • A Cloud 9 instance running in a private subnet
  • A docker container running inside the cloud9 instance
  • An application running insider the docker container
  • This application exposes a UI
  • You wish to access this UI from your laptop

Solution

  1. Expose the application port on the docker container (within the cloud9 environment)

In the below screenshot, I have a application running inside a docker container that’s exposed on port 1880.

Screenshot by the author

2. Install AWS CLI

3. Install Session Manager Plugin (link)

4. Configure your AWS credentials for the command line

5. Go to EC2 Console and find out the Instance ID of your cloud9 instance.

6. Run the below command, replace 1880 with some other port number if your application is exposed on another port.

AWS_PROFILE=<profile-name> aws ssm start-session…

--

--

Aravind

I help you continuously improve your life, ranging from health, serverless/devops & mindset. Personal views.