Skip to main content
The Python preset provides Python with pip and a virtual environment, managed by a systemd service.

Available Versions

Select a version when creating your pod. If not specified, Python 3.12 is used.

What’s Included

Pre-installed utilities: curl, wget, vim, htop, unzip.

Directory Structure

  • App Root: /home/instapod/app
  • App Port: 8000 (your app must listen on this port)
  • Virtual environment: /home/instapod/app/venv

How the App Service Works

Your Python app runs as a systemd service called app. It:
  • Runs /home/instapod/app/venv/bin/python app.py from the app directory
  • Starts automatically on boot
  • Restarts on crash (on-failure policy)
  • Logs to the system journal
  • Runs as the instapod user
The service expects your app to listen on port 8000. Traffic from your pod’s public URL is proxied to this port.
Your app must bind to 0.0.0.0 (not localhost or 127.0.0.1) on port 8000, otherwise it won’t be reachable from the public URL.

Virtual Environment

A Python virtual environment is automatically created at /home/instapod/app/venv when the pod is provisioned. It is also auto-activated on SSH and terminal login — you can use pip directly without activating it manually.

Deploying Your App

Upload and Reload

pods reload automatically runs pip install -r requirements.txt (using the venv) when it detects a requirements.txt in your app directory. You don’t need to install dependencies manually.

Example Flask App

Example FastAPI App

Gunicorn Auto-Detection

If gunicorn is installed in your virtual environment (listed in requirements.txt), pods reload automatically configures the systemd service to use gunicorn instead of python app.py:
If a wsgi.py file exists in your app directory, it uses wsgi:app as the module instead. This works out of the box for Django projects.

Viewing Logs

Adding a Database

Database services require the Build plan or higher.

Use Cases

  • Django applications
  • Flask / FastAPI APIs
  • Data science dashboards (Streamlit, Dash)
  • Machine learning model serving
  • Python scripts and automation