Deploy Flask on Oracle Cloud's free tier
A small Flask app on Gunicorn, running 24/7 on hardware that costs nothing.
At a glance
| Base image | python:3.12-slim |
|---|---|
| Port | 8000 |
| Build command | pip install -r requirements.txt |
| Start command | gunicorn wsgi:app --bind 0.0.0.0:8000 |
| Infrastructure cost | $0 on Oracle Always Free (platform fee for managed DevOps) |
Running Flask on Ampere ARM
Flask is tiny; the whole image lands around 120 MB on ARM64 and boots in well under a second.
Steps
- Add a wsgi entrypoint. Gunicorn needs a module-level app object.
# wsgi.py from app import create_app app = create_app() - Move config into env vars. SECRET_KEY, database URLs and API keys belong in project settings, never in the repo.
- Deploy. Push to your branch; Cheaploy rebuilds and swaps containers after the health check.
Dockerfile for Flask on ARM64
FROM python:3.12-slim
WORKDIR /app
ENV PYTHONUNBUFFERED=1
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt gunicorn
COPY . .
EXPOSE 8000
CMD ["gunicorn", "wsgi:app", "--bind", "0.0.0.0:8000", "--workers", "3"]Need one tailored to your repository? The free Dockerfile generator writes an ARM-ready multi-stage build for you.
Common mistakes
- Running the dev server in production: `flask run` is single-threaded and warns for a reason. Always use Gunicorn or uWSGI.
- Missing SECRET_KEY: Sessions silently break across restarts if the key is regenerated at boot.
- Writing to the container filesystem: Uploads vanish on redeploy unless you mount a volume or use object storage.
Related reading
Get the Oracle Always Free deploy checklist
One email with the exact steps, capacity workarounds and tools we use to ship apps for $0 of cloud spend.
One email, no spam. Unsubscribe anytime.
Frequently asked
Is Flask enough for production?+
Behind Gunicorn and a reverse proxy, yes — that is how most Flask apps run.
Can I use SQLite?+
For low-write workloads on a mounted volume, yes. Anything concurrent should use Postgres.
How do I schedule jobs?+
Add a cron container or use APScheduler in a separate worker process.
Deploy your project for $0
No credit card. No Oracle sales call. Ship to your own cloud in under 10 minutes.
Start free