Skip to main content

Server Setup

Backup Your Data

We believe in giving you the ability to access and use your data as you see fit.

It's important to backup your PromptPanel instance as container storage is ephemeral, if the container is destroyed the data from your embedded database and files will be lost.

Embedded Database

The main database is found at: /app/database/db.sqlite3.

There are a couple of ways which you can back this up from your container, but the recommended method would be to use the SQLite CLI to make a backup, and then copy that file out of the container.

An example of how to do this would be something like the following (where promptpanel is the container name):

docker exec promptpanel sqlite3 /app/database/db.sqlite3 ".backup /app/database/db_backup.sqlite3"

Next you'll want to copy the db_backup.sqlite3 file from your container with something like:

docker cp promptpanel:/app/database/db_backup.sqlite3 /path/to/local/directory/db_backup.sqlite3

Just Copy

Since the SQLite file is just a file, you could also just copy the database directly out of the container.

Use Caution: Database Consistency

Please use caution with this method, any running transactions which are occurring when copying can lead to database consistency issues.

docker cp promptpanel:/app/database/db.sqlite3 /path/to/local/directory/db.sqlite3

Media Files

Media files (like file uploads will me uploaded to the media directory and should similarly be backed up from the container).

docker cp promptpanel:/app/media /path/to/local/media

Volume Mounts

Volume mounting the directories is another solution for getting the data out of your container and onto your local machine.

Included below is a Docker Compose example where the media and database directories are mounted to the local filesystem in a relative directory to the docker-compose.yml file.

Use Caution: Database Consistency

Please use caution with this method, any running transactions which are occurring when moving or changing the database on your local filesystem can lead to database consistency issues.

version: "3.9"
services:
  promptpanel:
    image: promptpanel/promptpanel:latest
    container_name: promptpanel
    restart: always
    ports:
      - 4000:4000
    volumes:
      - ./database:/app/database
      - ./media:/app/media
    environment:
      PROMPT_OLLAMA_HOST: http://ollama:11434
  ollama:
    image: ollama/ollama:latest
    container_name: ollama
    restart: always