Example Projects

PSPDFKit Server comes with two example projects — one written in Ruby on Rails, and one written in Node.js — to demonstrate how to integrate PSPDFKit Server with your own backend.

If you’re looking into PSPDFKit for Web, we recommend you follow the Getting Started guide for Server-backed deployment instead.

Once you are ready to integrate with your own backend, you can set up an instance of PSPDFKit Server using our Deployment guide, which shows you the necessary docker-compose.yml file in detail.

  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.

    You can use any OS supported by Docker, including popular Linux distributions like Ubuntu, Debian, Fedora, Red Hat, or CentOS.

  2. Pull the pspdfkit image from Docker Hub:

    docker pull pspdfkit/pspdfkit
  3. Get one of our example apps.

    The examples provide docker-compose.yml and Dockerfile files that will work without additional configuration:

    To clone the example to your machine and switch to its directory, run the following commands:

    git clone git@github.com:PSPDFKit/pspdfkit-server-example-nodejs.git
    cd pspdfkit-server-example-nodejs
    git clone git@github.com:PSPDFKit/pspdfkit-server-example-rails.git
    cd pspdfkit-server-example-rails
  4. Run the example:

    docker-compose up

    You only have to provide the activation key once. After doing so, the server will remain activated until you reset it.

    The example app is now running on http://localhost:3000. It will prompt for a username, but you can enter anything to proceed.

    You can also access PSPDFKit Server’s dashboard at http://localhost:5000/dashboard with the username dashboard and the password secret.

    You can quit the running containers with Ctrl + C.

    If you want to test PSPDFKit for Web on different devices in your local network, you need to edit the PSPDFKIT_SERVER_EXTERNAL_URL environment variable in the docker-compose.yml file and set it to an address that’s reachable from your device.

  5. Follow the Getting Started guides for PSPDFKit Instant for Android, iOS, or Web.