Live in minutes, not sprints
npx surge-media init or a single Docker image. The CLI sets up your database, applies migrations and generates secrets. No build step, no third-party account to create.
Self-hosted · Headless · Source-available
Store, transform and deliver every image and video through one secure API. On your servers, under your domain, in every environment from dev to production. No per-transformation bill. No media leaving your infrastructure.
# Node.js 24+npm install @surge-media/corenpx surge-media init # SQLite, PostgreSQL or MySQLnpx surge-media start# …or Docker (amd64 · arm64)docker run -d -p 3000:3000 \ -v surge-media-data:/app/data \ ghcr.io/mahmoud-nb/surge-media✔ Admin, API and media delivery readyRuns on the stack you already trust
Why SurgeMedia
The convenience of a media SaaS, the control of your own infrastructure. SurgeMedia gives your teams one place to manage media, and your applications one API to consume it.
npx surge-media init or a single Docker image. The CLI sets up your database, applies migrations and generates secrets. No build step, no third-party account to create.
Your servers, your domain (media.your-company.com), your disk or S3-compatible bucket. Media never passes through a third party, which makes it ideal for GDPR and data-residency requirements.
SQLite out of the box for small teams and quick starts. PostgreSQL or MySQL / MariaDB for production at enterprise scale. Same package, same image, one variable.
Dev, staging and production read the same media library. Environment-tagged API keys per project: no more re-uploading assets or syncing buckets between stages.
Resize, crop, focal point, AVIF and WebP: just change the URL, and Sharp does the work. Video renditions (H.264, AV1), posters and subtitles with FFmpeg, off the request path.
Publishable and secret keys, scopes, expiry and rotation, CORS allow-lists, signed URLs and short-lived upload tokens. Project owners manage all of it, without filing a ticket with ops.
Admin, Manager, Developer and Editor across the platform; Owner, Developer and Editor per project. Everyone gets exactly the access they need, two-factor authentication can be required, and sensitive actions are audited.
Upload, organize in folders, tag, filter, set focal points, generate URLs and HTML snippets. Light and dark themes, English and French, built to WCAG 2.2 AA.
An OpenAPI 3.1 specification generated from the routes, an interactive reference in the admin, and stable error codes in application/problem+json.
Centralized media
Stop copying uploads from production to staging and losing them in between. Every environment of every application consumes the same media, each with its own keys.
Your applications
SurgeMedia
Your infrastructure
On-the-fly transformations
Upload the original once. SurgeMedia generates the variant your page asks for on the first request, keeps it, and serves it with immutable cache headers from then on.
<picture> <source type="image/avif" srcset="https://media.example.com/m/k7d2m9qz/v3/w_800,h_450/hero.avif" /> <source type="image/webp" srcset="https://media.example.com/m/k7d2m9qz/v3/w_800,h_450/hero.webp" /> <img src="https://media.example.com/m/k7d2m9qz/v3/w_800,h_450/hero.jpg" width="800" height="450" alt="Our new collection" /></picture>https://media.example.com/m/k7d2m9qz/v3/w_800,h_450,g_focal,q_70/hero.avif └──┬───┘ └┬┘ └─────────┬──────────┘ └──┬─────┘ media id version transformation name.formatw_ / h_ set the size, fit_ the strategy (cover, contain, inside…), g_focal keeps the subject in frame.jpg, png, webp or avif. Images are never upscaled and metadata (EXIF, GPS) is stripped.preview, or your own like card or og-image) freeze a transformation under a name. A project can also accept only presets, or only signed URLs.// GET /api/v1/projects/{projectId}/media/{mediaId}{ "id": "k7d2m9qz", "kind": "image", "width": 4032, "height": 3024, "altText": "Our new collection", "focalPoint": { "x": 0.62, "y": 0.4 }, "urlTemplate": "https://media.example.com/m/k7d2m9qz/v3/{transform}/hero.{format}"}Fill in {transform} and {format} client-side to build any srcset, with no extra request.
Installation
One npm package, one Docker image. Pick the database that fits today, and switch to PostgreSQL or MySQL as you grow.
# In the folder that will hold your configuration and data (Node.js 24+)npm install @surge-media/corenpx surge-media init # choose SQLite, PostgreSQL or MySQL / MariaDBnpx surge-media start # admin, API and delivery on http://localhost:3000docker run -d --name surge-media -p 127.0.0.1:3000:3000 \ -v surge-media-data:/app/data \ -e NUXT_SITE_URL=https://media.example.com \ -e NUXT_BOOTSTRAP_ADMIN_EMAIL=you@example.com \ -e NUXT_BOOTSTRAP_ADMIN_PASSWORD='a-long-passphrase' \ ghcr.io/mahmoud-nb/surge-media# Web server + video worker + PostgreSQL 17, from the repository's docker/ folderPOSTGRES_PASSWORD='change-me' docker compose -f docker/compose.postgres.yaml up -dSecurity & governance
Access control is not an add-on: it is how the API and the admin are designed.
SDKs
The REST API speaks to any language. MIT-licensed Vue components and a JavaScript client are on their way to npm, to make responsive images, videos and uploads a one-liner.
Fair-source pricing
The source code is public under the Business Source License 1.1. Production use is free for organizations under USD 500,000 in annual revenue.
Install SurgeMedia on your infrastructure in minutes. Development, testing and evaluation are free for everyone.