
Pocketbase is a powerful, open-source backend designed for SaaS and mobile applications, all implemented with a single file.
For comprehensive Pocketbase usage and implementation details, visit the Pocketbase Documentation.
Experience the capabilities of Pocketbase through the Live Demo.
To install Pocketbase on a Dokku server, follow these detailed steps:
git clone https://github.com/your-repo/dokku-pocketbase.git
dokku-pocketbase directory.
cd dokku-pocketbase
pocketbase on your server.
dokku apps:create pocketbase
dokku storage:ensure-directory pocketbase
dokku storage:mount pocketbase /var/lib/dokku/data/storage/pocketbase:/app/pb_data
dokku config:set pocketbase POCKETBASE_VERSION=0.22.4
git remote add dokku dokku@<YOUR_SERVER_IP>:pocketbase
git push dokku main
Pocketbase will now be operational on your server.
When deploying Pocketbase to a production environment on Dokku, it's crucial to configure the following environment variables. These ensure your application runs smoothly and securely.
POCKETBASE_ADMIN_EMAIL: Specifies the email address for the initial administrator account. This account is used to access the Pocketbase admin UI.POCKETBASE_ADMIN_PASSWORD: Sets the password for the initial administrator account. Choose a strong, unique password.POCKETBASE_APP_NAME: Defines the name of your application. This can be reflected in various parts of the Pocketbase system and UI.POCKETBASE_APP_URL: The public URL where your application will be accessible (e.g., https://your-app.dokku.example.com). This is important for ensuring Pocketbase generates correct links and for CORS settings if you have a separate frontend.You can set these environment variables using the dokku config:set command. Here's an example for each:
dokku config:set pocketbase POCKETBASE_ADMIN_EMAIL=admin@example.com
dokku config:set pocketbase POCKETBASE_ADMIN_PASSWORD=yourSuperSecretPassword
dokku config:set pocketbase POCKETBASE_APP_NAME="My Awesome App"
dokku config:set pocketbase POCKETBASE_APP_URL=https://my-awesome-app.dokku.example.com
Make sure to replace the example values with your actual desired configuration.
To select a different Pocketbase version, modify the Dockerfile or set the POCKETBASE_VERSION environment variable in your Dokku app.
Upgrade your Pocketbase instance to a new version with these commands:
dokku docker-options:add pocketbase build '--build-arg POCKETBASE_VERSION=0.22.22'
dokku ps:rebuild pocketbase
From version 0.16+, Pocketbase includes built-in backup and restore APIs accessible via the Admin UI (Settings > Backups).
While Pocketbase offers a convenient built-in backup feature through its Admin UI (accessible via Settings > Backups), it's important to establish a robust backup strategy for your production data.
Consider the following recommendations:
A well-thought-out backup strategy is crucial for data durability and disaster recovery.
Securing your Pocketbase instance is vital, especially in a production environment. Here are several recommendations to enhance the security of your deployment:
Keep Pocketbase Updated: Software vulnerabilities are discovered and patched over time. Regularly check the Pocketbase releases page and update your instance to the latest version. You can update the POCKETBASE_VERSION build argument in your Dockerfile or set it as an environment variable in Dokku and rebuild your app.
Strong Admin Credentials: The Pocketbase admin account provides full access to your data and settings.
POCKETBASE_ADMIN_EMAIL, POCKETBASE_ADMIN_PASSWORD) as described in the "Production Environment Variables" section. This prevents them from being hardcoded or easily discovered.Secure API Rules: Pocketbase allows you to define API rules for each collection, controlling who can access and modify data.
Enable HTTPS: Encrypting traffic between your users and your Pocketbase instance is essential.
Review Pocketbase Settings: Within the Pocketbase Admin UI (under Settings), review and configure the following:
POCKETBASE_APP_URL environment variable) is particularly important for security features like OAuth2 and email verification.Firewall: Implement a firewall at the server level (e.g., using ufw on Ubuntu).
By implementing these hardening measures, you can significantly improve the security posture of your Pocketbase application on Dokku.
Enhance Pocketbase by writing custom business logic in Go or JavaScript. Use the pb_hooks directory to create a portable backend. Learn more in the Pocketbase as a Framework guide.
Consult the Pocketbase Documentation or open an issue on our GitHub repository for any installation or usage problems.
Seeking a custom web application or a bespoke solution for your business? The BlockShift team can assist with:
Ready to start your project? Visit blockshift.us and discover more about our services.
We welcome contributions! For details on how to get started, review our Contributing Guide.
This project is licensed under the MIT License. View the LICENSE file for more details.
12 commits
Dockerfile
89.8%
JavaScript
10.2%

Pocketbase is a powerful, open-source backend designed for SaaS and mobile applications, all implemented with a single file.
For comprehensive Pocketbase usage and implementation details, visit the Pocketbase Documentation.
Experience the capabilities of Pocketbase through the Live Demo.
To install Pocketbase on a Dokku server, follow these detailed steps:
git clone https://github.com/your-repo/dokku-pocketbase.git
dokku-pocketbase directory.
cd dokku-pocketbase
pocketbase on your server.
dokku apps:create pocketbase
dokku storage:ensure-directory pocketbase
dokku storage:mount pocketbase /var/lib/dokku/data/storage/pocketbase:/app/pb_data
dokku config:set pocketbase POCKETBASE_VERSION=0.22.4
git remote add dokku dokku@<YOUR_SERVER_IP>:pocketbase
git push dokku main
Pocketbase will now be operational on your server.
When deploying Pocketbase to a production environment on Dokku, it's crucial to configure the following environment variables. These ensure your application runs smoothly and securely.
POCKETBASE_ADMIN_EMAIL: Specifies the email address for the initial administrator account. This account is used to access the Pocketbase admin UI.POCKETBASE_ADMIN_PASSWORD: Sets the password for the initial administrator account. Choose a strong, unique password.POCKETBASE_APP_NAME: Defines the name of your application. This can be reflected in various parts of the Pocketbase system and UI.POCKETBASE_APP_URL: The public URL where your application will be accessible (e.g., https://your-app.dokku.example.com). This is important for ensuring Pocketbase generates correct links and for CORS settings if you have a separate frontend.You can set these environment variables using the dokku config:set command. Here's an example for each:
dokku config:set pocketbase POCKETBASE_ADMIN_EMAIL=admin@example.com
dokku config:set pocketbase POCKETBASE_ADMIN_PASSWORD=yourSuperSecretPassword
dokku config:set pocketbase POCKETBASE_APP_NAME="My Awesome App"
dokku config:set pocketbase POCKETBASE_APP_URL=https://my-awesome-app.dokku.example.com
Make sure to replace the example values with your actual desired configuration.
To select a different Pocketbase version, modify the Dockerfile or set the POCKETBASE_VERSION environment variable in your Dokku app.
Upgrade your Pocketbase instance to a new version with these commands:
dokku docker-options:add pocketbase build '--build-arg POCKETBASE_VERSION=0.22.22'
dokku ps:rebuild pocketbase
From version 0.16+, Pocketbase includes built-in backup and restore APIs accessible via the Admin UI (Settings > Backups).
While Pocketbase offers a convenient built-in backup feature through its Admin UI (accessible via Settings > Backups), it's important to establish a robust backup strategy for your production data.
Consider the following recommendations:
A well-thought-out backup strategy is crucial for data durability and disaster recovery.
Securing your Pocketbase instance is vital, especially in a production environment. Here are several recommendations to enhance the security of your deployment:
Keep Pocketbase Updated: Software vulnerabilities are discovered and patched over time. Regularly check the Pocketbase releases page and update your instance to the latest version. You can update the POCKETBASE_VERSION build argument in your Dockerfile or set it as an environment variable in Dokku and rebuild your app.
Strong Admin Credentials: The Pocketbase admin account provides full access to your data and settings.
POCKETBASE_ADMIN_EMAIL, POCKETBASE_ADMIN_PASSWORD) as described in the "Production Environment Variables" section. This prevents them from being hardcoded or easily discovered.Secure API Rules: Pocketbase allows you to define API rules for each collection, controlling who can access and modify data.
Enable HTTPS: Encrypting traffic between your users and your Pocketbase instance is essential.
Review Pocketbase Settings: Within the Pocketbase Admin UI (under Settings), review and configure the following:
POCKETBASE_APP_URL environment variable) is particularly important for security features like OAuth2 and email verification.Firewall: Implement a firewall at the server level (e.g., using ufw on Ubuntu).
By implementing these hardening measures, you can significantly improve the security posture of your Pocketbase application on Dokku.
Enhance Pocketbase by writing custom business logic in Go or JavaScript. Use the pb_hooks directory to create a portable backend. Learn more in the Pocketbase as a Framework guide.
Consult the Pocketbase Documentation or open an issue on our GitHub repository for any installation or usage problems.
Seeking a custom web application or a bespoke solution for your business? The BlockShift team can assist with:
Ready to start your project? Visit blockshift.us and discover more about our services.
We welcome contributions! For details on how to get started, review our Contributing Guide.
This project is licensed under the MIT License. View the LICENSE file for more details.
12 commits
Dockerfile
89.8%
JavaScript
10.2%