"The PocketBase of CDNs" - Me
Utilizing an SQLite database with GORM and the Gin web framework. UI built with Vite + React and wouter.
See our documentation at kevinanielsen.github.io/go-fast-cdn/
Join the discord to talk to fellow users and contributors!
git clone git@github.com:kevinanielsen/go-fast-cdn
or git clone https://github.com/kevinanielsen/go-fast-cdn
This project uses dotenv and I recommend that you do the same.
Read more about the usage on their page.
If you do not wish to use this, you can just rename .example.env to .env and fill in the fields.
- Run
make prep - Run
make clean - Run
make test - Run
make build
Your binary should now be tested, built, and you can run it with bin/go-fast-cdn-linux or bin/go-fast-cdn-windows or bin/go-fast-cdn-darwin
git clone git@github.com:kevinanielsen/go-fast-cdn
or git clone https://github.com/kevinanielsen/go-fast-cdn
docker-compose up -d
The easiest way to get started without cloning the repo is to pull the image directly from Docker Hub:
docker pull kevinanielsen/go-fast-cdn
Or pin to a specific version:
docker pull kevinanielsen/go-fast-cdn:0.1.6
Run it with persistent storage:
docker run -d \
-p 8080:8080 \
-v go_fast_db:/app/db_data \
-v go_fast_uploads:/app/uploads \
kevinanielsen/go-fast-cdn
For production deployments, you can separate admin UI from public CDN serving using subdomains.
Nginx: See nginx/example.conf for a basic configuration.
Nginx Proxy Manager:
- Create proxy host for
admin.cdn.example.com→http://your-cdn:8080(full access) - Create proxy host for
cdn.example.com→http://your-cdn:8080 - Edit the
cdn.example.comproxy host → Custom Locations tab → Add:- Location:
/api/cdn/download/images/→ Forward tohttp://your-cdn:8080 - Location:
/api/cdn/download/docs/→ Forward tohttp://your-cdn:8080
- Location:
- Click the gear icon ⚙️ (top-right) → In Custom Nginx Configuration, add:
location / { return 403; } - Save. This blocks admin UI access on
cdn.example.com
This project uses goreleaser-cross v1.27.0 to support CGO cross-compilation, which is required for WEBP image processing across all platforms.
Note: We use v1.27.0 which provides stable cross-compilation support with updated repositories. Earlier versions (v1.21.5) had outdated Ubuntu repositories that caused package installation failures.
- Docker installed and running
- GitHub token with appropriate permissions
- Push access to the repository
# Test the release configuration
make test-release
# Dry run (test without publishing)
make release-dry-run
# Create and publish a release (requires GITHUB_TOKEN)
export GITHUB_TOKEN=your_github_token
make releaseThis project requires CGO for WEBP support via:
github.com/chai2010/webp(WEBP encoding)golang.org/x/image/webp(WEBP decoding)
Standard Go cross-compilation with CGO_ENABLED=0 would disable WEBP functionality. goreleaser-cross provides the necessary cross-compilation toolchains to build CGO-enabled binaries for all supported platforms while maintaining WEBP support.
- Linux: amd64, arm64, armv7
- macOS: amd64 (Intel), arm64 (M1/M2) - Universal binary
- Windows: amd64
All platforms include full WEBP support through CGO compilation using goreleaser-cross v1.27.0.
In addition to binary archives, Linux platforms also provide:
- Debian: .deb packages
- RedHat: .rpm packages
- Alpine: .apk packages