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 and need an activation key, we recommend referring to the Setting Up PSPDFKit Server guide for Server-backed deployment instead.
Once you’re 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.
Review our Docker guide to learn about all installation options. Reboot after installing Docker.
Verify that Docker works via typing
docker infointo a terminal. Ensure that the output includes
OSType: linux. If this is missing, revisit the installation instructions. PSPDFKit Server is a Linux-based Docker container and requires a Docker environment capable of running Linux containers.
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 https://github.com/PSPDFKit/pspdfkit-server-example-nodejs.git cd pspdfkit-server-example-nodejs
git clone https://github.com/PSPDFKit/pspdfkit-server-example-rails.git cd pspdfkit-server-example-rails
ℹ️ Note: If this command doesn’t work, you might need to install Git first.
Run the example:
ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE docker-compose up
set ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE docker-compose up
$env: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.
⚠️ Warning: If you get an error, you might need to install
docker-composeseparately. If the message is the “ERROR: Couldn’t connect to Docker daemon at http+docker://localunixsocket - is it running?” warning under Linux, check with
docker infoto see if the service is running. You might need to use
sudofor the compose command.