PocketHost and PocketBase are free, open-source projects for self-hosted backend databases and API servers. You can absolutely run PocketBase yourself on any server, including a Plesk-managed VPS or dedicated server, without paying for PocketHost’s cloud service4.
PocketBase (the code behind PocketHost) is Free and Open Source
PocketBase is released under the MIT license and its code can be found publicly. You can download, run, and modify it without fees. PocketHost is the managed/cloud offering of PocketBase; you are not required to use it to run PocketBase, and the server code is free4.
Detailed Steps: Run PocketBase on Your Plesk Server
1. Download PocketBase
- Go to https://pocketbase.io/ and download the latest PocketBase binary for your server’s OS (Linux, likely x86_64 or ARM64).
2. Upload and Prepare the Binary
- Via Plesk File Manager:
- Log in to Plesk.
- Go to Files, upload the downloaded binary to your desired directory (e.g., inside a website’s folder or a separate directory).
- Or via SSH:
- Upload the binary (
scp
orFTP
) to your server. chmod +x pocketbase
to make it executable.
- Upload the binary (
3. Start PocketBase
- Via SSH:
- SSH into your server.
- Navigate to the directory where you uploaded
pocketbase
. - Run:bash
./pocketbase serve
- By default PocketBase will serve HTTP API and admin UI at port
8090
.
4. Set Up a Reverse Proxy (Optional but Recommended)
- Because PocketBase runs on its own port, to access it at your domain (e.g.,
yourdomain.com/db
), set up a reverse proxy:- In Plesk, go to your domain > Apache & nginx Settings.
- In nginx settings, add this:text
location /db/ { proxy_pass http://127.0.0.1:8090/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; }
- Now you can reach PocketBase at
yourdomain.com/db
.
5. Enable PocketBase as a Service (Optional, for persistency)
- Create a systemd service so PocketBase runs in the background and survives reboots.
- Create
/etc/systemd/system/pocketbase.service
with:text[Unit] Description=PocketBase server [Service] ExecStart=/full/path/to/pocketbase serve WorkingDirectory=/full/path/to/ Restart=always [Install] WantedBy=multi-user.target
sudo systemctl enable --now pocketbase
- Create
6. Access PocketBase Admin UI
- Go to
http://yourdomain.com:8090/_/
(or the reverse proxy path) in your browser. - Set up your admin account and start creating collections (tables).
7. Add Database (Collections) and Fields
- Use the web UI (
/_/
) to create collections and fields—no manual SQL needed.
8. Connect Your App
- Use the REST API or SDKs for client or server interaction.
- API endpoint is
http://yourdomain.com:8090/api/
(adjust if using reverse proxy).
Verifying It’s Free and Open Code
- PocketBase’s source is available at https://github.com/pocketbase/pocketbase4.
- MIT License: Free for commercial and personal use, with code modifications permitted.
You do not need to register or pay—this is purely self-hosted and under your control.
Quick Summary Table
Action | Free/Open Source? | Admin Steps Needed |
---|---|---|
Download/Run PocketBase | Yes | Upload, chmod, run |
PocketHost Cloud Service | No (paid) | N/A |
Plesk Integration | Manual (no auto) | Setup reverse proxy |
If you need more integration with domains or custom subdomains in Plesk, use Plesk’s web server settings to handle routing as described above. All PocketBase code for self-hosting remains fre
How to Setup a Database in Your Self Hosted Pocketbase
To set up a database and table (called a “collection” in PocketBase) on your Plesk server after installing PocketBase, follow these step-by-step instructions so you can use the database with your AiCoder:
1. Access the PocketBase Admin Interface
- In your browser, go to your server’s address and PocketBase port.
Example:http://yourdomain.com:8090/_/
(Replace port and address as needed, depending on your server setup.) - Log in with your PocketBase admin credentials.
- If this is your first time, you’ll be prompted to create an admin account36.
2. Create a New Collection (Table)
- Click on the “New Collection” button (exact naming may vary, sometimes just “Add Collection”).
- Enter a name for your collection (for example,
users
orproducts
).
Collections in PocketBase act as database tables436. - Optionally, set a display name, description, and configure access rules as needed.
3. Add Fields to the Collection
- After creating your collection, you can add fields by clicking “Add Field”.
- For each field:
- Enter the field name (e.g.,
username
,email
,created_at
). - Select the field type (text, number, email, bool, date, etc.) according to your data needs4.
For example, for ausers
collection:username
(Text)email
(Email)age
(Number)created_at
(Date)
- Enter the field name (e.g.,
- Set any constraints (required, unique, default value), as desired.
- Save each field after adding it.
Example fields for a “users” collection:
username
(text, required, unique)created_at
(date, default now)436
4. (Optional) Add Sample Data
- With your collection/table created, you can add records directly in the admin UI.
- Click “Add Record” and fill out the form for each entry (user, product, etc.)36.
5. Note the API and Field Structure for AiCoder
- Review your collection and field names; you’ll need to tell AiCoder the exact name of the collection (table) and its fields.
- PocketBase auto-adds a unique
id
field to every collection; you don’t need to create this yourself4. - Example schema you should share with AiCoder in your prompt:
- Collection: users
- id (string, auto)
- username (string)
- email (string)
- created_at (datetime)
- Collection: users
6. Reference Your Collection in AiCoder Prompts
When using AiCoder, provide information such as:
“Connect to the PocketBase instance at
http://yourdomain.com:8090
. Use theusers
collection with fields:id
,username
,created_at
. Please fetch all users wherecreated_at
is after January 1, 2025.”
7. Test Your Setup
- Use the PocketBase admin interface to add, modify, and delete records for testing.
- Optionally, test the API using tools like
curl
or Postman to ensure it’s accessible and working.
References
- Collections and field types: PocketBase documentation4
- Step-by-step admin setup: YouTube tutorials36
If you need to automate this with code, PocketBase provides a REST API and SDKs, plus you can extend with JavaScript or Go for custom scripts25. But for most purposes, the web admin interface is the fastest and simplest route.
How to START your ai coder chat prompt for a NEW project with the credentials to use the new database host.
To begin your AiCoder project and connect it to your PocketBase database, start your chat prompt by providing all necessary connection and schema information directly and explicitly. This approach ensures AiCoder can authenticate, connect, and generate the correct queries for your configured collections (tables).
Here’s how to structure your prompt for best results:
Template: AiCoder Prompt for PocketBase Database
textConnect to my PocketBase instance at: http://yourdomain.com:8090
Credentials:
- (If your database is public, credentials may not be required. If authentication is enabled, provide admin/user email and password:)
- Email: myadmin@example.com
- Password: myStrongPassword
Target collection: users
users collection fields:
- id (auto-generated string, primary key)
- username (text, required, unique)
- email (email, required, unique)
- created_at (datetime, default: current time)
Instructions:
- Use the above credentials to authenticate if required.
- Perform all read and write operations on the "users" collection.
- Fetch, insert, update, or delete data as needed using the defined fields.
- For authentication, use the `/api/collections/users/auth-with-password` endpoint or equivalent method if logging in through the API.
Example task:
- List all users registered after January 1, 2025, showing username and email.
Details and Guidance:
- Always specify the PocketBase server URL (replace with your actual address and port).
- If authentication is active, provide an email and password with permission to access/modify the collection56.
- State the collection (table) name and its fields exactly as they are configured in PocketBase, including field types and constraints. This prevents ambiguity and ensures AiCoder generates correct queries or API calls68.
- Outline the basic actions you intend to perform (fetch, insert, etc.), so AiCoder can focus on those operations6.
- If you require authentication, AiCoder should follow the PocketBase method:
Example for Another Collection:
textPocketBase API url: http://yourdomain.com:8090
Auth email: teamlead@example.com
Auth password: Secret1234
Target collection: tasks
tasks fields:
- id (string, auto)
- title (text, required)
- description (text)
- assigned_to (user id, foreign key)
- status (text: "todo", "doing", "done")
- created_at (datetime)
Goal: Show all tasks assigned to the user with email alice@example.com, sorted by created_at.
Key Points:
- Your prompt should be self-contained—all connection, credential, and schema info in one place.
- Replace example info with real details from your PocketBase setup.
- If using additional security methods (like OAuth or token auth), mention this and provide necessary values or instructions56.
This format ensures AiCoder has everything it needs to operate with your PocketBase database at the start of every new project.
Here is an ai coder prompt that will set up an AUTH table just like the one Subabase provides. The coder will set up the AUTH table so for you.
Yu can instruct Bolt.net or similar AI Codr via a prompt to set up a new authentication table (an Auth collection in PocketBase) that works like Supabase’s Auth system. PocketBase natively supports authentication collections, including all needed user auth fields and workflows similar to Supabase Auth415.
Below is a detailed chat prompt you can give Bolt.net to have it create and configure an Auth table in your PocketBase instance for website authentication, mirroring the Supabase Auth table as closely as PocketBase’s system allows:
Prompt:
textSet up a new authentication table for my website in my PocketBase database.
- Create a new Auth collection called 'users'.
- The collection should include these fields:
- email (required, unique, used for login)
- emailVisibility (boolean, default: true – whether the user's email is public)
- verified (boolean, default: false – auto-set to true when the email is verified)
- password (required, hashed and stored securely)
- tokenKey (for session and recovery management)
- Make sure the system fields above are used as in PocketBase; they should match Supabase's Auth fields in function.
- Allow user registration, login, and password reset via email and password.
- Enable email verification on sign-up.
- Make sure the collection supports authentication endpoints for sign-up, sign-in, and password recovery.
- The Auth fields should not be editable or deletable, and should be compatible with PocketBase’s built-in auth flows.
- If supported, include the ability to add custom fields (e.g., “role”, “fullName”) to the users table for user management and access control.
Configure the collection so my website’s authentication can:
- Register users with email and password and require email verification before login.
- Log in with email and password.
- Reset forgotten passwords via secure email link or code.
Once this “users” table (Auth collection) is created, please provide code samples for:
- Registering a new user;
- Logging in and fetching the authentication token;
- Checking if a user is authenticated;
- Logging out a user.
How this works:
- PocketBase “Auth collections” (usually called “users”) come preconfigured with all the standard authentication fields you need (email, password, verified, etc.), just like Supabase Auth does. These fields are special, protected system fields in PocketBase and cannot be deleted or renamed, ensuring robust authentication4.
- Custom fields can be added for things like role, profile image, etc.4.
- Auth API endpoints (
authWithPassword
,authWithOTP
, registration, password reset, etc.) are available by default15. - You can use your prompt to have Bolt.net generate all necessary setup, including the collection and basic authentication code (examples are provided in official docs and libraries)15.
References from results:
- PocketBase Auth collections: system fields and workflow 4
- Email/password registration and login flows 15
- Example of user registration/login with code 5
- Custom field and role management for fine-grained control 46
Notes:
Make sure to update the placeholder values (like admin email, etc.) to match your actual configuration as needed.
After running this prompt, you’ll have an Auth table that mirrors Supabase Auth in behavior and can be used for secure website authentication.
Earlier we showed how to prompt your AI coder chat to access your existing pocketbase database table. Here is information on how to have your ai coder set up the database table and fields for you, allegedly.
Here’s a Bolt.net or similar AiCoder chat prompt to instruct the AI to set up a new table (collection) in your PocketBase database, including specifying field types and rules. This prompt works by guiding the AI to authenticate as a superuser and call the necessary PocketBase API to create a custom collection, fully compatible with PocketBase’s architecture134.
Prompt to Set Up a New PocketBase Table (Collection):
textYou are to administer my PocketBase instance at http://yourdomain.com:8090/.
1. Authenticate as a superuser using:
- Email: myadmin@example.com
- Password: mySuperSecurePassword123
2. Create a new collection (table) called "posts" with the following fields:
- title (type: text, required, min 10 characters)
- content (type: text)
- published (type: bool, default: false)
- tags (type: select, allowed values: "news", "update", "event", can select multiple)
- created (type: autodate, set automatically at creation)
- updated (type: autodate, set automatically at update)
3. Set the following API access rules for the "posts" collection:
- listRule: allow any authenticated user to view posts
- viewRule: allow any authenticated user to view a specific post
- createRule: allow only admin users to create posts
- updateRule: allow only post creator or admin to update posts
- deleteRule: allow only post creator or admin to delete posts
4. Provide a code sample (in JavaScript using the PocketBase client SDK) showing how to create a new "posts" record with title, content, published status, and tags.
Use the PocketBase API for all operations. If any step fails due to permissions, handle authentication as required and continue. When finished, confirm the new collection's schema in your summary.
How This Works:
- The AI will authenticate as a superuser, required for collection/table creation14.
- The collection “posts” will be set up with specific fields and types (with options for select/multiselect)3.
- You direct the AI to apply specific access rules for list, view, create, update, and delete8.
- The last step asks for a concrete code sample to show you how records would be created in this collection using the PocketBase JavaScript SDK1.
You can adapt the prompt:
- Change
"posts"
and the field definitions to match your project needs. - Adjust the access rules (“listRule”, etc.) to fit your security requirements.
- Replace the endpoint and superuser credentials with your real values.
Note: Bolt.net AiCoder will interpret and generate code/scripts or API usage to implement this setup on your live PocketBase instance, including giving you a ready-made client-side snippet for interacting with your new table1234.
References used:
Leave a Reply