A web-based dashboard to create, manage, and monitor multiple PocketBase instances using PM2 process manager.
- π¦ Create Instances - Download and set up PocketBase instances with a few clicks
- π― Version Selection - Choose from available PocketBase versions from GitHub releases
- β‘ Process Management - Start, stop, restart instances via PM2
- π Status Monitoring - Real-time status updates every 5 seconds
- π Log Viewer - View PM2 logs directly from the dashboard
- π Authentication - Secure login system
- π¨ Modern UI - Clean, responsive interface with TailwindCSS
- Python 3.8+
- Node.js (for PM2)
- PM2 - Install globally:
npm install -g pm2
-
Clone or navigate to the project directory:
cd PBManager -
Create a virtual environment:
python3 -m venv venv source venv/bin/activate # On macOS/Linux # or venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
-
Create environment file:
cp .env.example .env
-
Edit
.envand configure your settings:nano .env
Important: Change the default admin credentials!
Edit the .env file to customize:
| Variable | Description | Default |
|---|---|---|
SECRET_KEY |
Flask secret key (change in production!) | - |
ADMIN_USERNAME |
Admin username | admin |
ADMIN_PASSWORD |
Admin password | admin123 |
INSTANCES_DIR |
Directory to store PocketBase instances | ~/pocketbase-instances |
DEFAULT_PORT_START |
Starting port for instances | 7200 |
Start the application:
python app.pyAccess the dashboard at: http://127.0.0.1:5000
Default credentials:
- Username:
admin - Password:
admin123
- Click "New Instance" button
- Enter instance name (e.g.,
my-blog) - Select PocketBase version
- Optionally specify a port (auto-assigned if left empty)
- Click "Create"
The manager will:
- Download the selected PocketBase version (if not cached)
- Create instance directory with proper structure:
~/pocketbase-instances/my-blog/ βββ pocketbase (executable) βββ pb_hooks/ βββ pb_migrations/ βββ pb_data/ (created on first run) - Register the instance in the database
Each instance card provides buttons to:
βΆοΈ Start - Start the PocketBase instance with PM2- βΈοΈ Stop - Stop the running instance
- π Restart - Restart the instance
- π Logs - View PM2 logs (last 200 lines)
- ποΈ Delete - Remove instance (with confirmation)
Once an instance is running, click on its port number to open PocketBase admin UI in a new tab:
http://localhost:7200/_/
PBManager/
βββ app.py # Flask application entry point
βββ config.py # Configuration management
βββ requirements.txt # Python dependencies
β
βββ core/ # Business logic
β βββ github_service.py # GitHub API integration
β βββ download_service.py # PocketBase download management
β βββ instance_service.py # Instance CRUD operations
β βββ pm2_service.py # PM2 process control
β βββ auth_service.py # Authentication
β
βββ models/ # Database models
β βββ database.py # SQLAlchemy setup
β βββ instance.py # Instance model
β
βββ routes/ # Flask routes
β βββ auth.py # Login/logout
β βββ dashboard.py # Main dashboard
β βββ api.py # REST API endpoints
β
βββ templates/ # Jinja2 templates
β βββ base.html
β βββ login.html
β βββ dashboard.html
β
βββ static/ # Static assets
βββ css/
β βββ style.css
βββ js/
βββ utils.js
βββ dashboard.js
All API endpoints require authentication:
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/versions |
Get available PocketBase versions |
| GET | /api/instances |
List all instances with status |
| POST | /api/instances |
Create new instance |
| GET | /api/instances/<id> |
Get instance details |
| DELETE | /api/instances/<id> |
Delete instance |
| POST | /api/instances/<id>/start |
Start instance |
| POST | /api/instances/<id>/stop |
Stop instance |
| POST | /api/instances/<id>/restart |
Restart instance |
| GET | /api/instances/<id>/logs |
Get instance logs |
| GET | /api/instances/<id>/status |
Get instance status |
Set in .env:
FLASK_DEBUG=True
SQLite database is stored at: storage/instances.db
All PocketBase instances are stored in the directory specified in INSTANCES_DIR (default: ~/pocketbase-instances/)
Downloaded PocketBase versions are cached in: ~/pocketbase-instances/.downloads/
Ensure PM2 is installed globally:
npm install -g pm2
pm2 --versionIf the default port 7200 is in use, the manager will auto-increment to the next available port. You can also manually specify a port when creating an instance.
Check PM2 logs:
pm2 logs pb_<instance-name>Or view logs through the dashboard's Logs button.
Delete the database and restart:
rm storage/instances.db
python app.py- Auto-refresh: Instance statuses refresh every 5 seconds
- Port range: Default port starts at 7200 and increments for each new instance
- OS Support: Automatically detects OS (Linux, macOS, Windows) and downloads appropriate PocketBase binary
- Version cache: Downloaded PocketBase versions are cached to speed up future instance creation
- Change default admin credentials immediately
- Use a strong
SECRET_KEYin production - Consider setting up HTTPS for production deployments
- The dashboard is designed for local/trusted network use
This project is open source and available for personal and commercial use.
- PocketBase - Open source backend
- PM2 - Process manager
- Flask - Web framework
- TailwindCSS - CSS framework
