Getting Started

PSPDFKit Server is the backend for PSPDFKit clients. It is distributed as a Docker container.

We recommend using Docker Machine, Kubernetes, or native Docker support by a cloud provider like Amazon Web Services, Google Cloud Platform, or Microsoft Azure for deployment in production.

ℹ️ Note: If you just want to get an example up and running quickly, use the preconfigured Docker setup from our Example Projects.

The steps below outline how to get a simple setup on a single host up and running via docker-compose.

  1. Make sure you have Docker installed and running.

    On macOS we recommend the most recent version of Docker for Mac.

    On Windows we recommend the most recent version of Docker for Windows.

  2. Pull the pspdfkit image from Docker Hub:

    1
    
    docker pull pspdfkit/pspdfkit
    
  3. Create the following docker-compose.yml file somewhere on your file system:

    Copy
    docker-compose.yml
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    
    version: '2'
    
    services:
      db:
        image: postgres:9.6
        environment:
          POSTGRES_USER: pspdfkit
          POSTGRES_PASSWORD: password
          POSTGRES_DB: pspdfkit
          POSTGRES_INITDB_ARGS: --data-checksums
          PGDATA: /var/lib/postgresql/data/pgdata
        restart: always
        volumes:
          - pgdata:/var/lib/postgresql/data
    
      pspdfkit:
        image: "pspdfkit/pspdfkit:latest"
        environment:
          PGUSER: pspdfkit
          PGPASSWORD: password
          PGDATABASE: pspdfkit
          PGHOST: db
          PGPORT: 5432
    
          # Activation key for your PSPDFKit Server installation.
          ACTIVATION_KEY: YOUR_ACTIVATION_KEY_GOES_HERE
    
          # Secret token used for authenticating API requests.
          API_AUTH_TOKEN: secret
    
          # Base key used for deriving secret keys for the purposes of authentication.
          SECRET_KEY_BASE: secret-key-base
    
          # Public key used for verification of JWTs from web clients. It has to be in the PEM format.
          JWT_PUBLIC_KEY: |
            -----BEGIN PUBLIC KEY-----
            MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALd41vG5rMzG26hhVxE65kzWC+bYQ94t
            OxsSxIQZMOc1GY8ubuqu2iku5/5isaFfG44e+VAe+YIdVeQY7cUkaaUCAwEAAQ==
            -----END PUBLIC KEY-----
          JWT_ALGORITHM: RS256
    
          # Credentials to access the admin dashboard.
          DASHBOARD_USERNAME: dashboard
          DASHBOARD_PASSWORD: secret
        depends_on:
        - db
        restart: always
        ports:
          - "5000:5000"
        volumes:
        - asset_storage:/srv/asset_storage
    
    volumes:
      pgdata:
      asset_storage:
    
  4. In a terminal tab, navigate to the directory where you’ve placed the docker-compose.yml file and execute the following:

    1
    
    docker-compose up
    

    Make sure that navigating to http://localhost:5000/dashboard in a web browser shows the dashboard, which can be accessed with the username dashboard and the password secret (you can configure these values using the environment variables in the docker-compose.yml file).

    You can quit the running containers with Ctrl-C.

  5. Now follow the guides to integrate PSPDFKit for Web into your app’s frontend and backend.

Take a look at our Troubleshooting guide for solutions to common issues.