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

Galaxy CLI

Deploy and manage your Web Apps from the terminal with four commands.

Deploying a Meteor App?

This guide is for Web Apps. For Meteor, use the Meteor CLI instead.

Prerequisites


Quick Start

npm install -g @galaxy-cloud/cli
galaxy login
galaxy init
galaxy deploy

Install

npm install -g @galaxy-cloud/cli
npx @galaxy-cloud/cli login
npx @galaxy-cloud/cli init
npx @galaxy-cloud/cli deploy

Deploy

Authenticate

galaxy login

Opens your browser for OAuth. Run galaxy whoami to confirm your account.

Initialize your project

galaxy init

The CLI walks you through setup: app name, app type (Node.js, Next.js, AdonisJS, or Python), runtime version, plan, region, container size, and build commands.

Next.js Apps Need Standalone Mode

Next.js apps require output: 'standalone' in your next.config.ts. The CLI validates this and shows an error if it's missing.

Deploy

galaxy deploy

The CLI packages your code, builds a Docker image, and deploys. Logs stream in real-time. Each deployment creates a new version with zero downtime.

Every future deploy is just galaxy deploy from your project directory.


Configuration Files

.galaxy/config.json (private): Links your directory to a Galaxy app. Created during galaxy init or galaxy link. Never commit this to Git.

galaxy.json (shareable): Your deployment configuration. Safe to commit so your team shares the same settings.

{
  "commands": {
    "install": "npm install",
    "build": "npm run build",
    "start": "npm start"
  },
  "health": {
    "path": "/health"
  },
  "deploy": {
    "rootDirectory": "./"
  }
}

.galaxyignore (optional): Exclude files from deployments, like .gitignore. Default patterns (.git/, node_modules/, *.log, .env) apply automatically. Maximum archive size is 100MB.


Command Reference

Authentication

CommandDescription
galaxy loginAuthenticate via browser
galaxy logoutClear local credentials
galaxy whoamiShow current user and organizations

Project Setup

CommandDescription
galaxy initCreate a new app and link your directory
galaxy link <app-id>Link to an existing app
galaxy link <app-id> --with-configLink and pull config from backend
galaxy unlinkDisconnect directory from app
galaxy configShow and validate current configuration

Finding Your App ID

Grab it from your dashboard URL: https://my.galaxycloud.app/{account}/{region}/apps/{appId}/overview

Deployment

CommandDescription
galaxy deployDeploy with real-time log streaming
galaxy deploy --path <dir>Deploy from a specific directory
galaxy deploy --env <file>Deploy with env vars from a file
galaxy deploy --detachFire-and-forget (skip log streaming)

Logs

CommandDescription
galaxy logs --deployment <id>View build and deploy logs

Environment Variables

Galaxy uses a staging workflow: make changes, then deploy them.

CommandDescription
galaxy variablesList all variables (values masked)
galaxy variables --env <file>Import variables from a .env file
galaxy variables:set KEY VALUEStage a variable change
galaxy variables:unset KEYStage a variable deletion
galaxy variables:deployApply all pending changes
galaxy variables:statusCheck for pending changes
galaxy variables:diff <id>See what changed in a deployment

Changes Require Deployment

variables:set and variables:unset only stage changes. Run galaxy variables:deploy to apply them.

Use variables:deploy for config-only changes (fast, no build). Use galaxy deploy when your code changed. To do both at once: galaxy deploy --env .env.production.


Team Collaboration

When teammates clone your repo, they run galaxy link <app-id> to connect their local directory, then deploy normally. The galaxy.json file is safe to commit. The .galaxy/config.json file is gitignored and machine-specific.

Want automatic deployments? Connect any CLI-created app to GitHub or Bitbucket from the Galaxy dashboard. See the Push to Deploy guide. Switching to Git doesn't disable the CLI.


Troubleshooting


What's Next?