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

What’s Included

ComponentVersionDetails
Python3.12Python runtime
pipBundledPackage manager
venvBuilt-inVirtual environment (auto-created)
systemdProcess manager (app service)
SSHOpenSSHAccess via dedicated port

Directory Structure

/home/instapod/app/
├── requirements.txt
├── app.py              # (or your entry point)
└── venv/               # Virtual environment
  • App Root: /home/instapod/app
  • App Port: 8000 (your app must listen on this port)

How the App Service Works

Your Python app runs as a systemd service called app. It:
  • Starts automatically on boot
  • Restarts on crash
  • Logs to the system journal
  • Runs as the instapod user
  • Uses the virtual environment at /home/instapod/app/venv
The service expects your app to listen on port 8000. Traffic from your pod’s public URL is proxied to this port.

Deploying Your App

Upload and Start

# Sync your project
instapod files sync my-python-app --local ./my-project

# Install dependencies
instapod exec my-python-app -- /home/instapod/app/venv/bin/pip install -r requirements.txt

# Restart the app service
instapod pods reload my-python-app

Example Flask App

# app.py
from flask import Flask

app = Flask(__name__)

@app.route('/')
def hello():
    return 'Hello from InstaPods!'

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8000)
# requirements.txt
flask>=3.0
gunicorn>=21.2

Example FastAPI App

# app.py
from fastapi import FastAPI
import uvicorn

app = FastAPI()

@app.get('/')
def hello():
    return {'message': 'Hello from InstaPods!'}

if __name__ == '__main__':
    uvicorn.run(app, host='0.0.0.0', port=8000)

Viewing Logs

instapod logs my-python-app -s app

Adding a Database

instapod services add my-python-app --service postgresql --wait
instapod services creds my-python-app --service postgresql

Use Cases

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