{"id":14941222,"url":"https://github.com/blockshiftnetwork/dokku-pocketbase","last_synced_at":"2026-01-07T12:58:01.853Z","repository":{"id":89215467,"uuid":"531980988","full_name":"blockshiftnetwork/dokku-pocketbase","owner":"blockshiftnetwork","description":"Install Pocketbase on Dokku a Heroku Alternative","archived":false,"fork":false,"pushed_at":"2024-09-21T11:03:54.000Z","size":17,"stargazers_count":14,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-24T02:02:18.395Z","etag":null,"topics":["api","backend","dokku","dokku-application","dokku-ready","heroku","pocketbase"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blockshiftnetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-02T15:29:01.000Z","updated_at":"2024-09-21T11:03:57.000Z","dependencies_parsed_at":"2024-03-18T15:36:29.626Z","dependency_job_id":"35340ac6-efd4-4a0b-a8c3-5fdf48556f58","html_url":"https://github.com/blockshiftnetwork/dokku-pocketbase","commit_stats":null,"previous_names":["blockshiftnetwork/dokku-pocketbase"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockshiftnetwork%2Fdokku-pocketbase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockshiftnetwork%2Fdokku-pocketbase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockshiftnetwork%2Fdokku-pocketbase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockshiftnetwork%2Fdokku-pocketbase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blockshiftnetwork","download_url":"https://codeload.github.com/blockshiftnetwork/dokku-pocketbase/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234129083,"owners_count":18784156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","backend","dokku","dokku-application","dokku-ready","heroku","pocketbase"],"created_at":"2024-09-24T02:00:34.251Z","updated_at":"2025-09-24T21:31:07.640Z","avatar_url":"https://github.com/blockshiftnetwork.png","language":"Dockerfile","funding_links":[],"categories":["Self Hosting"],"sub_categories":[],"readme":"# Pocketbase Dokku\n\n![Pocketbase Logo](https://user-images.githubusercontent.com/8460736/188195613-01a44972-24eb-459c-a437-cdfa34b1bf73.png)\n\n[Pocketbase](https://pocketbase.io) is a powerful, open-source backend designed for SaaS and mobile applications, all implemented with a single file.\n\n## Pocketbase Documentation\n\nFor comprehensive Pocketbase usage and implementation details, visit the [Pocketbase Documentation](https://pocketbase.io/docs).\n\n## Pocketbase Live Demo\n\nExperience the capabilities of Pocketbase through the [Live Demo](https://pocketbase.io/demo/).\n\n## How to Install Pocketbase on Dokku\n\nTo install Pocketbase on a Dokku server, follow these detailed steps:\n\n1. **Clone the Repository**: Download the repository onto your local machine.\n   ```sh\n   git clone https://github.com/your-repo/dokku-pocketbase.git\n   ```\n2. **Navigate to Directory**: Change to the `dokku-pocketbase` directory.\n   ```sh\n   cd dokku-pocketbase\n   ```\n3. **Create a Dokku App**: Set up a new Dokku app named `pocketbase` on your server.\n   ```sh\n   dokku apps:create pocketbase\n   ```\n4. **Ensure Persistent Storage**: Create a directory for persistent storage.\n   ```sh\n   dokku storage:ensure-directory pocketbase\n   ```\n5. **Mount Storage**: Attach the persistent storage to your Pocketbase app.\n   ```sh\n   dokku storage:mount pocketbase /var/lib/dokku/data/storage/pocketbase:/app/pb_data\n   ```\n6. **Set Pocketbase Version**: (Optional) Specify the Pocketbase version.\n   ```sh\n   dokku config:set pocketbase POCKETBASE_VERSION=0.22.4\n   ```\n7. **Add Dokku Remote**: Link your local repository to the Dokku remote.\n   ```sh\n   git remote add dokku dokku@\u003cYOUR_SERVER_IP\u003e:pocketbase\n   ```\n8. **Deploy Pocketbase**: Push your application to the Dokku server.\n   ```sh\n   git push dokku main\n   ```\n\nPocketbase will now be operational on your server.\n\n## Production Environment Variables\n\nWhen 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.\n\n- `POCKETBASE_ADMIN_EMAIL`: Specifies the email address for the initial administrator account. This account is used to access the Pocketbase admin UI.\n- `POCKETBASE_ADMIN_PASSWORD`: Sets the password for the initial administrator account. Choose a strong, unique password.\n- `POCKETBASE_APP_NAME`: Defines the name of your application. This can be reflected in various parts of the Pocketbase system and UI.\n- `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.\n\nYou can set these environment variables using the `dokku config:set` command. Here's an example for each:\n\n```sh\ndokku config:set pocketbase POCKETBASE_ADMIN_EMAIL=admin@example.com\ndokku config:set pocketbase POCKETBASE_ADMIN_PASSWORD=yourSuperSecretPassword\ndokku config:set pocketbase POCKETBASE_APP_NAME=\"My Awesome App\"\ndokku config:set pocketbase POCKETBASE_APP_URL=https://my-awesome-app.dokku.example.com\n```\n\nMake sure to replace the example values with your actual desired configuration.\n\n## Customizing Pocketbase Version\n\nTo select a different Pocketbase version, modify the Dockerfile or set the `POCKETBASE_VERSION` environment variable in your Dokku app.\n\n## Upgrading Pocketbase\n\nUpgrade your Pocketbase instance to a new version with these commands:\n\n1. Add Docker build argument:\n   ```sh\n   dokku docker-options:add pocketbase build '--build-arg POCKETBASE_VERSION=0.22.22'\n   ```\n2. Rebuild your app:\n   ```sh\n   dokku ps:rebuild pocketbase\n   ```\n\n## Pocketbase Backups\n\nFrom version 0.16+, Pocketbase includes built-in backup and restore APIs accessible via the Admin UI (Settings \u003e Backups).\n\n## Backup Strategy\n\nWhile Pocketbase offers a convenient built-in backup feature through its Admin UI (accessible via Settings \u003e Backups), it's important to establish a robust backup strategy for your production data.\n\nConsider the following recommendations:\n\n- **Regularly Schedule Backups**: Automate your backups to run at regular intervals (e.g., daily or weekly) depending on your data change frequency and recovery point objectives (RPO).\n- **Secure Off-site Storage**: Store your backups in a separate and secure location, preferably off-site from your Dokku server. This could be a cloud storage service (like AWS S3, Google Cloud Storage, Backblaze B2) or another physical server. This protects your data in case of server-level failures.\n- **Test Restore Procedures**: Periodically test your backup restoration process to ensure your backups are valid and can be restored successfully.\n- **Refer to Official Documentation**: For detailed instructions on creating, managing, and restoring backups, always consult the official [Pocketbase Documentation](https://pocketbase.io/docs/backups/). The documentation provides the most up-to-date and comprehensive guidance.\n\nA well-thought-out backup strategy is crucial for data durability and disaster recovery.\n\n## Security Hardening\n\nSecuring your Pocketbase instance is vital, especially in a production environment. Here are several recommendations to enhance the security of your deployment:\n\n- **Keep Pocketbase Updated:** Software vulnerabilities are discovered and patched over time. Regularly check the [Pocketbase releases page](https://github.com/pocketbase/pocketbase/releases) 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.\n\n- **Strong Admin Credentials:** The Pocketbase admin account provides full access to your data and settings.\n    - Use a strong, unique password for this account.\n    - Set the admin email and password via environment variables (`POCKETBASE_ADMIN_EMAIL`, `POCKETBASE_ADMIN_PASSWORD`) as described in the \"Production Environment Variables\" section. This prevents them from being hardcoded or easily discovered.\n\n- **Secure API Rules:** Pocketbase allows you to define API rules for each collection, controlling who can access and modify data.\n    - Apply the principle of least privilege: only grant the necessary permissions.\n    - Carefully craft your API rules to prevent unauthorized data access or modification. Review these rules regularly, especially when your application logic changes.\n\n- **Enable HTTPS:** Encrypting traffic between your users and your Pocketbase instance is essential.\n    - Dokku offers robust Let's Encrypt integration for free SSL/TLS certificates. This is the recommended way to enable HTTPS.\n    - Refer to the [Dokku SSL documentation](https://dokku.com/docs/networking/ssl/) for detailed instructions on configuring HTTPS for your app.\n\n- **Review Pocketbase Settings:** Within the Pocketbase Admin UI (under Settings), review and configure the following:\n    - **Application Name \u0026 URL:** Ensure these are set correctly. The Application URL (`POCKETBASE_APP_URL` environment variable) is particularly important for security features like OAuth2 and email verification.\n    - **Allowed CORS Origins:** If your frontend is hosted on a different domain, specify the allowed origins to prevent cross-site request forgery (CSRF) and other web vulnerabilities. Be as specific as possible.\n    - Other security-related settings as they become available in newer Pocketbase versions.\n\n- **Firewall:** Implement a firewall at the server level (e.g., using `ufw` on Ubuntu).\n    - Restrict access to only necessary ports (typically 80 for HTTP and 443 for HTTPS).\n    - This provides an additional layer of defense against network-based attacks.\n\nBy implementing these hardening measures, you can significantly improve the security posture of your Pocketbase application on Dokku.\n\n## Pocketbase Custom Business Logic\n\nEnhance 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](https://pocketbase.io/docs/use-as-framework/) guide.\n\n## Troubleshooting Pocketbase\n\nConsult the [Pocketbase Documentation](https://pocketbase.io/docs) or open an issue on our [GitHub repository](https://github.com/blockshiftnetwork/dokku-pocketbase/issues) for any installation or usage problems.\n\n# Custom Web and Mobile Solutions\n\nSeeking a custom web application or a bespoke solution for your business? The BlockShift team can assist with:\n\n- Custom Laravel/PHP application development\n- Vue.js or JavaScript solutions for web and mobile applications\n- Expert consulting services for existing applications\n\n## Contact Us\n\nReady to start your project? Visit [blockshift.us](https://blockshift.us/contact/) and discover more about our services.\n\n## Contributing\n\nWe welcome contributions! For details on how to get started, review our [Contributing Guide](/CONTRIBUTING.md).\n\n## License Information\n\nThis project is licensed under the MIT License. View the [LICENSE](LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockshiftnetwork%2Fdokku-pocketbase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblockshiftnetwork%2Fdokku-pocketbase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockshiftnetwork%2Fdokku-pocketbase/lists"}