🚀App Platform (PaaS)

Deploy Your First App — Complete Walkthrough

By the Domain India teamPublished 7 min read
Knowledge base article
Contents (10 sections)

This walkthrough takes you from an empty folder on your computer to a live website on the Domain India App Platform. You'll write a tiny Node.js app, test it locally, and deploy it with a deploy token. No previous deployment experience is needed, and you don't need Git, Docker or an SSH key.

Key takeaways

Create three small files (index.js, package.json and a Procfile), run the app locally, then create an app in the client area. In the app's Deploy Tokens tab, create a token and copy the ready-to-run command it shows. Package your folder with tar, run that command, and open your app's address from the Overview tab. The two rules that decide whether it works: listen on PORT, and bind to 0.0.0.0.

Already have an app?

If your code is ready and you only need the deploy step, see Deploying with a deploy token. For the overview of how the platform works, see Getting started with the App Platform.

1. What you need

You needHow to checkIf it's missing
Node.jsnode --versionInstall a current LTS release from nodejs.org
A terminalTerminal on macOS or Linux, PowerShell on WindowsAlready installed
tar and curltar --version and curl --versionBuilt in on macOS, Linux, and Windows 10 and 11
An App Platform planApp Platform in the client area menuSee plans, apps and limits

On Windows, use PowerShell, not the old Command Prompt.

This guide uses Node.js because Node.js apps are detected and built automatically. Python, PHP and other languages also run on the platform, but they need a Dockerfile in your project; the getting-started guide has a minimal Python example.

2. Create the project

bash
mkdir hello-app
cd hello-app

Create three files in that folder.

index.js, the application:

javascript
const http = require('http');

// The platform tells your app which port to use.
// On your computer there is no PORT, so fall back to 3000.
const port = process.env.PORT || 3000;

const server = http.createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
  res.end('<h1>Hello from App Platform</h1><p>My first deployment.</p>');
});

// 0.0.0.0 accepts connections from outside the container.
server.listen(port, '0.0.0.0', () => {
  console.log(`Listening on port ${port}`);
});

package.json, which tells the platform this is a Node.js project:

json
{
  "name": "hello-app",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "start": "node index.js"
  }
}

Procfile, with no file extension, which says how to start the app:

text
web: node index.js

That's the whole application, with no dependencies to install.

3. The two rules that decide whether your app works

Almost every "the build succeeded but my site doesn't load" problem comes down to one of these:

  1. Listen on the port in PORT. Never hard-code a port number.
  2. Bind to 0.0.0.0, not localhost. An app bound to localhost only accepts connections from inside its own container, so visitors see nothing.
javascript
server.listen(3000, 'localhost');             // wrong: unreachable
server.listen(process.env.PORT, '0.0.0.0');   // right

4. Run it on your computer first

If it doesn't run locally, it won't run on the platform either.

bash
PORT=3000 node index.js

On Windows PowerShell:

powershell
$env:PORT=3000; node index.js

You should see Listening on port 3000. Open http://localhost:3000 in your browser and you should see "Hello from App Platform". Stop the server with Ctrl+C.

5. Create the app and a deploy token

  1. in your client area menu.
  2. Click New App
    and give it a name. If your plan has room, it's created straight away with nothing more to pay.
  3. Open the app.
    Its web address is on the Overview tab.
  4. Open Access › Deploy Tokens
    and click Create Token. Name it, for example laptop.
  5. Copy the ready-to-run command
    the tab shows. It already contains your new token and your app's deploy address.
The token is shown only once

Only a hash of the token is stored, so it can't be shown again. If you lose it, revoke it and create another.

6. Package and deploy

Move up one level, to the folder that contains hello-app, and package it:

bash
cd ..
tar czf app.tar.gz --exclude=node_modules --exclude=.git -C hello-app .

-C hello-app . packages the contents of hello-app, not the folder itself. That matters: the platform expects package.json at the top of the archive.

Now paste and run the command you copied from the Deploy Tokens tab, in the same folder as app.tar.gz. Don't type the command by hand; copying it avoids a wrong address or a leftover placeholder.

The command waits while your app builds, then prints the result. Behind the scenes:

  1. Your archive is received.
  2. The platform finds package.json and treats the project as Node.js.
  3. Dependencies are installed and the app is built.
  4. A health check runs on the new version.
  5. Traffic switches to it with no downtime.

You can follow the same build output in the Deploys tab.

7. Open your live site

Go to the app's Overview tab and open its address. You should see "Hello from App Platform", served over HTTPS.

8. Change something and deploy again

Edit the message in index.js:

javascript
res.end('<h1>Hello from App Platform</h1><p>Updated!</p>');

Then repeat step 6: package, then run the same upload command. Refresh your site and the change is live. This is the loop you'll use from now on.

9. If something goes wrong

What you seeWhat it means
Missing Authorization: Bearer …The Authorization line is missing from the command
Invalid or expired deploy token (401)The token is wrong, expired or revoked; the placeholder is still in the command; or the command names a different app
Upload exceeds 512 MB (413)Exclude node_modules and large files
Build failsThe upload worked; read the build log in the Deploys tab
Build succeeds, site doesn't loadAlmost always rule 2: bind to 0.0.0.0 and read PORT

More fixes are in Troubleshooting the App Platform.

10. Next steps

Do I need Git or Docker to deploy my first App Platform app?

No. For a Node.js app you only need Node.js, tar and curl. You package your folder with tar and upload it with the command from your app's Deploy Tokens tab.

Where do I find the deploy command?

Create a token in your app's Deploy Tokens tab. The tab then shows a ready-to-run command with your token and your app's deploy address already filled in.

Can I deploy a Python app the same way?

Yes, with a Dockerfile. Only Node.js is detected automatically, so Python, PHP and other languages need a Dockerfile in the root of the project.

Why does my site not load after a successful build?

Usually the app isn't reading the PORT environment variable or is bound to localhost. Listen on PORT and bind to 0.0.0.0, then deploy again.

How do I update my site after the first deploy?

Package the folder again with tar and run the same upload command. The new version replaces the old one with no downtime.

Ready to go live? Open your App Platform apps, compare App Platform plans, or ask us in a support ticket.

Deploy your first app

App Platform plans start at 1 app with PostgreSQL, free SSL and custom domains included.

See App Platform plans

Ready when you are

Get the App Platform from ₹100/mo + GST

See plans

Was this article helpful?

Your answer helps us decide what to improve next.

Still need help? Open a support ticket and our team will reply.

Prefer an app? Add this site to your home screen.Get the app
Deploy your first app on the App Platform | Domain India