Running on Galaxy Legacy? Visit the legacy docs.
Galaxy

Python Reference

Environment variables, advanced configuration, and deployment reference for Python apps on Galaxy.

Environment Variables

Set these in the Galaxy deployment form or your app's Settings page.

Core Variables

VariableRequiredDefaultDescription
PORTYes5000Port your app listens on. Galaxy assigns this automatically.
PYTHONUNBUFFEREDYes(none)Set to 1 to ensure immediate output flushing
PYTHON_VERSIONNo(none)Specify Python version if needed

Common Application Variables

VariableDefaultDescription
DEBUGfalseEnable debug mode (set to 0 for production)
LOG_LEVELinfoLogging verbosity
TZUTCTimezone for your app

Advanced Configuration

Custom Build Commands

Most Python apps don't need a build step. If yours does, set it in Galaxy:

  • Build Command: Custom command (e.g., python manage.py collectstatic --noinput)
  • Start Command: gunicorn app:app or python main.py

Galaxy runs install, then build (if set), then start.

Health Check Endpoint

Create a simple health check endpoint for Galaxy to monitor:

@app.route('/health')
def health():
    return {
        'status': 'ok',
        'timestamp': datetime.now().isoformat()
    }, 200

In the Galaxy deployment form, set Health Check Path to /health.

Supported Versions

Galaxy supports Python 3.10, 3.11, 3.12, 3.13, and Python 2.7 (legacy). For best compatibility, use Python 3.12 or 3.13.

Select your Python version via the Docker Preset option during deployment or in your app's Settings page.


Need Help?

Quick Help

Live chat is fastest for urgent issues. Available directly from your Galaxy dashboard.