Running on Galaxy Legacy? Visit the legacy docs.
Galaxy
Web Apps

AdonisJS

Deploy your AdonisJS app on Galaxy with zero-downtime deploys and autoscaling.

Deploy your AdonisJS 6.x app on Galaxy with zero-downtime deploys and autoscaling.

Prerequisites


1. Prepare Your App

Galaxy compiles your TypeScript and runs the output. Three things are required:

Define your scripts in package.json:

{
  "type": "module",
  "scripts": {
    "build": "node ace build",
    "start": "node bin/server.js"
  }
}

Generate an APP_KEY (if you haven't already):

node ace generate:key

Copy the output. You'll set this as an environment variable in Galaxy.

Listen on process.env.PORT:

AdonisJS reads PORT from your .env by default. Galaxy sets it automatically, so no code change is needed. Just make sure you're not hardcoding a port in bin/server.ts.


2. Deploy

Connect your repo

Go to your Galaxy dashboard, click Create New, then Deploy New App. Select AdonisJS as the app type and connect your GitHub or Bitbucket account.

Select repo and branch

Pick your repository and the branch to deploy from (usually main).

Choose plan and container

Select a plan (Sandbox for testing, Production for live apps) and a container size. Start small, scale later.

Set environment variables and deploy

Add your APP_KEY, NODE_ENV=production, and any database variables. Hit Deploy.

Galaxy runs npm install, npm run build, and npm start automatically.

Every push to your deploy branch triggers a new deployment automatically.

Install the CLI

npm install -g @galaxy-cloud/cli

Log in

galaxy login

Deploy

From your project root:

galaxy deploy my-app-name

For more CLI options, see the Galaxy CLI guide.


3. Configure (Optional)

Database migrations: Set a Pre-Deploy Command to node ace migration:run --force (paid plans only).

Health check path: Point Galaxy at /health (you'll need to add a route for it).

Environment variables: See the AdonisJS Reference for the full list, including database configuration.


4. Try It


Troubleshooting


What's Next?