Skip to content

Installing Papra from source

This guide covers building and running Papra directly from source code. This method is an alternative to Docker for users who prefer running applications natively on their system.

  • Full control: Access to all source files for customization
  • Development ready: Ideal for contributing or debugging
  • No containerization required: Runs directly on your system

Ensure you have the following installed on your system:

  • Node.js: Version 24 or higher
  • pnpm: Version 10 or higher

Verify your installation with:

Terminal window
node --version # Should show v24.x.x or higher
pnpm --version # Should show 10.x.x or higher
  1. Clone the Repository

    Terminal window
    git clone https://github.com/papra-hq/papra.git
    cd papra
  2. Install Dependencies

    Terminal window
    pnpm install
  3. Build All Packages

    Terminal window
    pnpm -r build
  4. Copy Client Files to Server

    Create the public directory and copy the built client files:

    Terminal window
    mkdir -p apps/papra-server/public
    cp -r apps/papra-client/dist/* apps/papra-server/public/
  5. Create Configuration File

    Navigate to the server directory:

    Terminal window
    cd apps/papra-server

    First, generate a secure secret key for authentication:

    Generated locally in your browser - no network or server involved

    Then create a papra.config.yaml file in this directory with the following content:

    server:
    servePublicDir: true
    baseUrl: http://localhost:1221
    auth:
    secret: <your-generated-secret-key>

    Alternatively, you can use papra.config.json:

    {
    "$schema": "https://docs.papra.app/papra-config-schema.json",
    "server": {
    "servePublicDir": true,
    "baseUrl": "http://localhost:1221"
    },
    "auth": {
    "secret": "<your-generated-secret-key>"
    }
    }
  6. Start the Server

    Run the server with database migrations:

    Terminal window
    pnpm start:with-migrations

The application will be available at http://localhost:1221.

Papra uses configuration files (papra.config.yaml or papra.config.json) for settings.

OptionDescriptionDefault
server.servePublicDirServe the client files from the public directoryfalse
server.baseUrlThe base URL of your Papra instance-
auth.secretSecret key for authentication-

For a complete list of configuration options, refer to the configuration reference.

To update your from-source installation:

  1. Pull the Latest Changes

    Terminal window
    git pull origin main
  2. Reinstall Dependencies

    Terminal window
    pnpm install
  3. Rebuild All Packages

    Terminal window
    pnpm -r build
  4. Copy Updated Client Files

    Terminal window
    mkdir -p apps/papra-server/public
    cp -r apps/papra-client/dist/* apps/papra-server/public/
  5. Restart the Server

    Terminal window
    cd apps/papra-server
    pnpm start:with-migrations

Server returns “API route not found” for all pages

Section titled “Server returns “API route not found” for all pages”

Ensure that:

  • The public directory exists in apps/papra-server/
  • The client files have been copied to apps/papra-server/public/
  • The server.servePublicDir option is set to true in your configuration file

Papra looks for configuration files in the following order:

  1. papra.config.yaml
  2. papra.config.json
  3. papra.config.ts

Make sure your configuration file is in the apps/papra-server/ directory and has the correct filename.