DEV Community

Rabeeh Ebrahim
Rabeeh Ebrahim

Posted on • Originally published at

Deploy Your Nodejs app on

If you finish a project using Nodejs and wondering where to deploy for free. You have come to the right place. Before talking about this let's talk about why you should deploy your project in the cloud. The main thing is that you can showcase your project to the world. Where others can benefit from your app and also you can showcase it to the recruiter. It helps in landing a job.

There are many cloud services to deploy but here I am focusing on Why render? because it's completely free. You got free 100 GB bandwidth and 500 build minutes. That’s enough to deploy your project as a student or as a hobbyist. Now, let's start the step-by-step process to deploy the app.

Step 1 - Create an Account

Sign up for I recommend you sign up using a GitHub account. So it will be more convenient to add projects from your repository. And also make sure that you push your project into a GitHub repository without .env and node_modules.

Step 2 - Select the Repository

Click the “new” button on the navbar then select “web service”. Select the repository you want to deploy in the list under “connect a repository” and click “connect”. If you don’t find your list, click on the Configure account under your GitHub account username. Select your username on the install render page. Select ‘All repositories’ and save.

Step 3 - Create Nodejs App

Fill in the name of your project. If you want to deploy from another branch select branch from the drop-down menu or leave it as the default value. Change your start command to a node + the name of the main file to execute in order to run the application. In my case, it will be ‘node app.js’. And click the “Create Web Service” to initiate your Nodejs app.

Step 4 - Add Environment Values

Voilà! you just created your first Nodejs app. But there is another important thing to do. Which is adding environment variables. remember that we ignored .env files while pushing the code. So we need to add env variables to the deployed app manually. Click on the environment on the side panel. Click “Add Environment Variable”. Add key and value there. After adding all environments click “save changes”.

Finally, we made it. The app should be redeployed again after updating the environment variables. Check the log section to see any errors. Wait for some minutes and check the URL provided right below the project name.

Thanks for reading! Hope you like it. Follow me for more content like this.

Top comments (0)