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.
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.
pspdfkitimage from Docker Hub:
docker pull pspdfkit/pspdfkit
Get one of our example apps.
The examples provide
Dockerfilefiles that will work without additional configuration:
To clone the example to your machine and switch to its directory, run the following commands:
git clone email@example.com:PSPDFKit/pspdfkit-server-example-nodejs.git cd pspdfkit-server-example-nodejs
git clone firstname.lastname@example.org:PSPDFKit/pspdfkit-server-example-rails.git cd pspdfkit-server-example-rails
Run the example:
ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE docker-compose up
set ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE 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
dashboardand the password
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_URLenvironment variable in the
docker-compose.ymlfile and set it to an address that’s reachable from your device.