Deploy Node.js application using Exopods
We will guide you through the process of creating a Node.js application, containerising it using Docker, and deploying it effortlessly with Exopods. By the end of this guide, you'll have a live Node.js application running in the cloud.
Prerequisites
Before we begin, make sure you have the following installed on your computer:
Node.js and npm: You can download them from https://nodejs.org/en/download/package-manager
Docker Desktop: Download it from https://www.docker.com/get-started/
A Docker Hub account: Create a free account at https://hub.docker.com/
Creating a Node.js Application and Docker Image
1. Initialize a New Node.js Project
Open your terminal or command prompt.
Navigate to the directory where you want to create your project.
Run the following command to initialize a new Node.js project:
This will create a
package.json
file with default settings.
2. Install Express.js
Install Express.js, a popular web framework for Node.js, using npm:
3. Create an index.js
File
Create a new file named
index.js
in your project directory.Add the following code to
index.js
:
4. Update package.json
Open the
package.json
file and add astart
script:
5. Create a Dockerfile
Create a new file named
Dockerfile
in the root of your project directory.Add the following content to
Dockerfile
:
6. Build and Push the Docker Image to Docker Hub
Build the Docker image:
Replace
my-node-app
with your desired image name.Log in to Docker Hub:
Enter your Docker Hub username and password.
Push the Docker image:
Copy the image URL:
You can find the image URL on Docker Hub. It will be in the format
your-docker-hub-username/my-node-app
Configure Your Deployment on Exopods
Now, we will set up the deployment configuration in Exopods. This involves specifying the container’s name, image URL, port, and other configurations.
Navigate to the deployment configuration page on Exopods.
Fill in the required details:
Container Name.
Docker Image Repo URL.
Port.
Environment Variables.
Arguments.

Deploy and Obtain Your Public URL
Finally, deploy your configured application and get a public URL within seconds.
Click the Deploy button on the Exopods interface.
Wait for the deployment process to complete (usually about 5 seconds).
Note the public URL provided by Exopods for your application.

Conclusion
You’ve successfully deployed your Node.js application using Docker and Exopods. Thank you for following along, and happy deploying!
Last updated