> For the complete documentation index, see [llms.txt](https://docs.hostinger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostinger.com/node.js/overview-1/express.md).

# Express.js

Minimal, unopinionated Node.js HTTP framework. Hostinger runs Express apps in server mode — a long-lived Node process handles every request.

**`app_type`:** `express`

## Server mode

Express is server-only; there's no static mode.

### `package.json`

```json
{
  "scripts": {
    "start": "node server.js",
    "dev": "node --watch server.js"
  },
  "dependencies": {
    "express": "^4.21.0"
  }
}
```

For TypeScript:

```json
{
  "scripts": {
    "build": "tsc",
    "start": "node dist/server.js"
  }
}
```

### Minimal `server.js`

```js
import express from 'express';

const app = express();
const port = process.env.PORT ?? 3000;

app.get('/', (_req, res) => res.send('Hello from Express'));

app.listen(port, () => {
  console.log(`Listening on ${port}`);
});
```

### hPanel settings

**Plain JavaScript:**

| Field            | Value           |
| ---------------- | --------------- |
| Application type | `express`       |
| Build script     | — (leave blank) |
| Output directory | — (leave blank) |
| Entry file       | `server.js`     |

**TypeScript:**

| Field            | Value            |
| ---------------- | ---------------- |
| Application type | `express`        |
| Build script     | `build`          |
| Output directory | `dist`           |
| Entry file       | `dist/server.js` |

## Static mode

Not applicable. If you want to serve static assets alongside Express, use `express.static('public')` inside your server.

## Notes

* **Bind to `process.env.PORT`, not a hardcoded port.** Hostinger assigns a port at runtime; hardcoding causes conflicts.
* For production, enable gzip and security headers:

  ```js
  import compression from 'compression';
  import helmet from 'helmet';
  app.use(compression());
  app.use(helmet());
  ```
* Process auto-restart: if your app crashes, Hostinger restarts it.

***

*Last updated: July 21, 2026*
