Prepare your app
New project? Run npm create hono@latest and pick the nodejs template. Then change the port so it comes from the environment:
import { serve } from '@hono/node-server'
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hello Hono!'))
app.get('/healthz', (c) => c.text('ok'))
serve({
fetch: app.fetch,
port: Number(process.env.PORT) || 3000,
}, (info) => {
console.log(`Listening on port ${info.port}`)
})The template hardcodes port: 3000. That happens to match the PORT we set today, but reading the variable means a change on our side can't break your app. Leave out hostname: without it the server listens on every interface.
The template's scripts work as they are:
"scripts": {
"dev": "tsx watch src/index.ts",
"build": "tsc",
"start": "node dist/index.js"
}Dev dependencies are installed during the build, so typescript and tsx can stay there. We run the compiled dist/index.js, not tsx, in production. Hono runs on our default Node 22, no version setting needed.
Static files
Serve a folder of files with the Node adapter's own serveStatic. Paths are relative to the project root, which is the working directory when the app starts:
import { serveStatic } from '@hono/node-server/serve-static'
app.use('/static/*', serveStatic({ root: './' }))Files in ./static are then served at /static/…. Commit them to the repo, or generate them in the build script. Files the app writes while running are lost on the next deploy.
Shut down cleanly
Every redeploy stops the old container, and on the Free plan so does sleep. Both send SIGTERM. We run your start script directly when it's a single command like node dist/index.js, so the signal reaches Node. Closing the server is up to you:
const server = serve({ fetch: app.fetch, port: Number(process.env.PORT) || 3000 })
process.on('SIGTERM', () => {
server.close(() => process.exit(0))
})Environment variables
Add variables in the project's settings. They're available both while the app builds and while it runs, so build-time values (like framework-public keys) work without extra setup. See Environment variables. Read them with process.env.NAME. Never commit a .env file.
Add a database
Add a Postgres addon (or Redis) and DATABASE_URL (or REDIS_URL) is injected automatically. The database isn't reachable while the app builds, so run migrations before the server starts: set the Start command in Settings → Build to, for example, npx drizzle-kit migrate && node dist/index.js.
Health check
Every deploy requests your health check path (/ by default) and only goes live once it returns a 2xx or 3xx status. The platform keeps checking it after that. If / returns 404 or needs a login, add a route like /healthz that returns 200 and set it as the Health Check Path in Settings. Otherwise the deploy fails and the previous version keeps serving.
Host a Hono API for free
The Free plan costs nothing and needs no card. It includes:
- One project, live over HTTPS at
<project-slug>.ethiodeploy.app. - 256 MB of memory and half a CPU core.
- A managed Postgres, MySQL or Redis addon with 512 MB of storage. It doesn't expire.
- A redeploy on every push, the same as the paid plans.
The catch is sleep. After 30 minutes without traffic the app stops, and the next request starts it again. We hold that request for up to 30 seconds while the app boots, so the first visitor after a quiet spell waits a little.
Hono is small, so an API built with it uses little of the Free plan's 256 MB. If the API serves a frontend or a mobile app, remember the first request after 30 quiet minutes waits while the container starts.
When the app has to stay awake or needs your own domain, Pro is $10 or 1,399 ETB a month: always on, 1 GB of memory and a 5 GB database.
Deploy
- Sign in with GitHub and install the EthioDeploy app on the repo.
- Click “New Project” and pick the repo.
- Watch the build in the dashboard. When the health check passes, your app is live at
<project-slug>.ethiodeploy.app. Every push to the default branch redeploys, and the old version keeps serving until the new one is healthy.
Troubleshooting
The app never answered on port $PORT
Cause: The app never calls serve(), uses a port other than PORT, or passes hostname: 'localhost'.
Fix: Call serve() from @hono/node-server with port: Number(process.env.PORT) || 3000 and no hostname.
Cannot find module '…/dist/index.js'
Cause: TypeScript was never compiled, or tsconfig's outDir isn't dist.
Fix: Keep "build": "tsc" with outDir: "./dist", or point the start script at your outDir.
tsc: not found during the build
Cause: typescript isn't in package.json, so it isn't installed.
Fix: Add it as a dev dependency (npm install -D typescript), commit the lockfile and redeploy.
/ returns 404 and the deploy fails
Cause: The API has no route at /, and the health check requests / by default.
Fix: Add app.get('/healthz', (c) => c.text('ok')) and set /healthz as the Health Check Path in Settings.
Still stuck? Check the deployment's build log in the dashboard, or see Troubleshooting.
Questions
The nodejs template from npm create hono@latest. It uses @hono/node-server and has build (tsc) and start (node dist/index.js) scripts that work on EthioDeploy as they are.
Your routes carry over, but the entry point doesn't. Install @hono/node-server and start the app with serve({ fetch: app.fetch, port: Number(process.env.PORT) || 3000 }) instead of export default app.
Yes. The Free plan runs one project with a 512 MB Postgres database at no cost. The app sleeps after 30 minutes without traffic and wakes on the next request, and the container has 256 MB of memory. Pro ($10/month) keeps it always on with 1 GB.
Ready to deploy?
Sign in with GitHub and pick your repo. No Dockerfile, no YAML.
More guides
All guides on the deploy guides page. Custom domains, env vars, addons and billing are in the docs.