PocketBase + SvelteKit (Static) Project Template
November 26, 2025 ยท View on GitHub
Tip
Check out my new template pocketbase-react-static
It's
v2of the template. The old version could be found in branchv1.
Welcome to the PocketBase + SvelteKit project template! This template allows you to effortlessly create a single Docker container housing both the backend (PocketBase) and frontend (SvelteKit) for your projects. With a minimal image size of just 59 MB, it's perfect for cost-effective hosting providers and projects without extensive public pages that require SEO. It's still possible to prerender some pages with SvelteKit, but it's not the main focus of this template.
Features
- PocketBase extended with Go (PocketBase 0.25.8)
- SvelteKit with adapter-static (Svelte 5.22.2, TypeScript, Tailwind CSS)
- Ready to use login, registration, and auth-requiring routes
- Single binary with embedded frontend (~47 MB)
- GitHub Action to build and push the Docker image (~59 MB) to
ghcr.io
Quickstart
- Fork this repository
- Replace all
github.com/YOUR-ORG/YOUR-REPOto your GitHub repo. For instance,github.com/Egor-S/my-awesome-project - Update default app settings in
pocketbase/migrations/1739793600_initial_settings.go
- Replace all
- Start your PocketBase server
cd pocketbase && go run . servein the first terminal- Create a superuser account
- Start your SvelteKit dev server
cd sveltekit && npm run devin the second terminal - Access both SvelteKit and PocketBase at
localhost:5173
Find more details in respective README files.
Build and run Docker image
To build the Docker image locally, run:
docker build . -t my-awesome-project:latest
The image is simple enough to be run without docker compose:
docker run -p 8090:8090 -v ./pb_data:/app/pb_data my-awesome-project:latest
Get single binary
container_id=$(docker create my-awesome-project:latest)
docker cp $container_id:/app/pocketbase ./pocketbase
docker rm $container_id
Contributing
We welcome contributions! Please feel free to submit issues or pull requests.
License
This project is licensed under the MIT License.
Acknowledgements
Special thanks to PocketBase, SvelteKit, and the authors of other PocketBase-SvelteKit templates (1, 2).
Contact
If you have any questions or feedback, please use the GitHub Issues page.