Python
Deploy your Python app on Galaxy with zero-downtime deploys and autoscaling.
Deploy your Python app on Galaxy with zero-downtime deploys and autoscaling.
Prerequisites
- A Galaxy account
- Your app in a Git repo with a
requirements.txt(orpyproject.toml) - A payment method added for identity verification
1. Prepare Your App
Galaxy installs your dependencies and runs your start command. Two things are required:
Listen on the PORT environment variable:
import os
port = int(os.getenv('PORT', 5000))
app.run(host='0.0.0.0', port=port)List your dependencies in requirements.txt:
Flask==2.3.0
gunicorn==20.1.02. Deploy
Connect your repo
Go to your Galaxy dashboard, click Create New, then Deploy New App. Select Python 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.
Configure and deploy
Set your app name, region, start command (e.g., gunicorn app:app or python main.py), and any environment variables. Hit Deploy.
Galaxy installs your dependencies via pip install -r requirements.txt and starts your app.
Every push to your deploy branch triggers a new deployment automatically.
Install the CLI
npm install -g @galaxy-cloud/cliLog in
galaxy loginFor more CLI options, see the Galaxy CLI guide.
3. Configure (Optional)
Start command: Set how Galaxy starts your app (e.g., gunicorn app:app, uvicorn main:app --host 0.0.0.0).
Health check path: Point Galaxy at an endpoint like /health so it can verify your app is running.
Environment variables: Set PYTHONUNBUFFERED=1 for proper log output. See the Python Reference for a full list.
4. Try It
Flask Tutorial
Official Flask tutorial app from the Pallets project
FastAPI Full-Stack Template
Official production-grade FastAPI template
Django Starter
Production-ready Django project template

