Thanks to visit codestin.com
Credit goes to github.com

Skip to content

nazt/pocketbase-docker-nginx

Repository files navigation

PocketBase Docker with Nginx

Production-ready PocketBase setup with Docker Compose and Nginx reverse proxy.

Quick Start

  1. Clone the repository:
git clone https://github.com/nazt/pocketbase-docker-nginx.git
cd pocketbase-docker-nginx
  1. Copy the environment file:
cp .env.example .env
  1. Start the services:
docker-compose up -d
  1. Access PocketBase:

Services

PocketBase

  • Port: 8092 (direct access)
  • Data: ./data/pb_data (local volume)
  • Version: 0.29.3 (configurable via build args)

Nginx

  • Port: 80 (HTTP)
  • Proxy: Routes to PocketBase on port 8080
  • Config: ./nginx/nginx.conf

Architecture

[Client] → [Nginx:80] → [PocketBase:8090] → [Local Volume:./data/pb_data]

Directory Structure

.
├── Dockerfile              # PocketBase custom image
├── docker-compose.yml      # Service orchestration
├── nginx/
│   └── nginx.conf         # Nginx reverse proxy config
├── data/
│   └── pb_data/          # PocketBase data (gitignored)
├── .env.example           # Environment template
└── README.md              # This file

Upgrading PocketBase

To upgrade PocketBase to a newer version:

# Upgrade to specific version
PB_VERSION=0.30.0 docker compose build pocketbase
docker compose up -d pocketbase

# Or edit docker-compose.yml and rebuild
docker compose build pocketbase
docker compose up -d pocketbase

Admin Setup

First-time setup requires creating an admin account:

  1. Navigate to http://localhost/_/
  2. Create your admin account
  3. Configure PocketBase settings

Backup & Restore

Backup

docker-compose exec pocketbase /pb/pocketbase backup

Restore

Place backup in ./data/pb_data and restart:

docker-compose down
docker-compose up -d

Development

View logs

docker-compose logs -f pocketbase
docker-compose logs -f nginx

Restart services

docker-compose restart

Stop services

docker-compose down

Remove all data (WARNING!)

docker-compose down -v
rm -rf ./data/pb_data/*

Security Notes

  • PocketBase admin panel is at /_/ path
  • Configure "User IP proxy headers" in PocketBase settings (X-Real-IP, X-Forwarded-For)
  • For production, use SSL/TLS certificates with Nginx
  • Change default admin credentials immediately

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •