DEV Community

Cover image for Introduction & Setup PocketBase
Jannis
Jannis

Posted on • Edited on • Originally published at Medium

Introduction & Setup PocketBase

Today we are going to dive into PocketBase and set it up!

πŸ’‘ What's PocketBase?

PocketBase is an open-source Backend-as-a-service (BaaS). It offers all necessary needed features like authentication, file storage, realtime database and web dashboard.

PocketBase uses an SQLite Database behind the scene and is written in Go. They offer an awesome JavaScript/Go SDK and you can even extend it by using it as a Go Framework.

You are able to configure permission rules, OAuth2, external file storage (S3) and mail (SMTP).

PocketBase
PocketBase Demo:

Β πŸ› οΈ Setup Pocketbase

The setup of Pocketbase is so easy it takes less than 1 minute to be able to start using it!

Download & extract

Download the archive from the documentation that's correct for you operating system. Now move it in the root folder in your project.

Archive in root folder

Next extract the archive and you should be left with a folder which contains an executable (pocketbase).

Extracted Archive

Start Pocketbase

Move into this directory and run the ./pocketbase serve command.



cd ./<directory

./pocketbase serve


Enter fullscreen mode Exit fullscreen mode

Terminal with commands to start PocketBase

And you are all set up! Visit the Admin UI page to setup your admin account and start using PocketBase!

🐳 Setup via docker-compose

In the favor of many developers there's a way to set it up via Docker as well.

Repo: https://github.com/muchobien/pocketbase-docker

Even easier than above you just add the pocketbase to your docker-compose.yml file like that:



version: "3.7"
services:
  pocketbase:
    image: ghcr.io/muchobien/pocketbase:latest
    container_name: pocketbase
    restart: unless-stopped
    command:
      - --encryptionEnv #optional
      - ENCRYPTION #optional
    environment:
      ENCRYPTION: example #optional
    ports:
      - "8090:8090"
    volumes:
      - /path/to/data:/pb_data
      - /path/to/public:/pb_public #optional


Enter fullscreen mode Exit fullscreen mode

After starting your docker stack it automatically installs and sets up PocketBase and you're instantly ready to start working!

Thanks for reading!
Support me

Top comments (0)