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
Prerequisites
Section titled “Prerequisites”Ensure you have the following installed on your system:
- Node.js: Version 24 or higher
- pnpm: Version 10 or higher
Verify your installation with:
node --version # Should show v24.x.x or higherpnpm --version # Should show 10.x.x or higherBuilding from Source
Section titled “Building from Source”-
Clone the Repository
Terminal window git clone https://github.com/papra-hq/papra.gitcd papra -
Install Dependencies
Terminal window pnpm install -
Build All Packages
Terminal window pnpm -r build -
Copy Client Files to Server
Create the public directory and copy the built client files:
Terminal window mkdir -p apps/papra-server/publiccp -r apps/papra-client/dist/* apps/papra-server/public/ -
Create Configuration File
Navigate to the server directory:
Terminal window cd apps/papra-serverFirst, generate a secure secret key for authentication:
Generated locally in your browser - no network or server involvedTerminal window node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"Then create a
papra.config.yamlfile in this directory with the following content:server:servePublicDir: truebaseUrl: http://localhost:1221auth: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>"}} -
Start the Server
Run the server with database migrations:
Terminal window pnpm start:with-migrations
The application will be available at http://localhost:1221.
Configuration Options
Section titled “Configuration Options”Papra uses configuration files (papra.config.yaml or papra.config.json) for settings.
| Option | Description | Default |
|---|---|---|
server.servePublicDir | Serve the client files from the public directory | false |
server.baseUrl | The base URL of your Papra instance | - |
auth.secret | Secret key for authentication | - |
For a complete list of configuration options, refer to the configuration reference.
Updating
Section titled “Updating”To update your from-source installation:
-
Pull the Latest Changes
Terminal window git pull origin main -
Reinstall Dependencies
Terminal window pnpm install -
Rebuild All Packages
Terminal window pnpm -r build -
Copy Updated Client Files
Terminal window mkdir -p apps/papra-server/publiccp -r apps/papra-client/dist/* apps/papra-server/public/ -
Restart the Server
Terminal window cd apps/papra-serverpnpm start:with-migrations
Troubleshooting
Section titled “Troubleshooting”Server returns “API route not found” for all pages
Section titled “Server returns “API route not found” for all pages”Ensure that:
- The
publicdirectory exists inapps/papra-server/ - The client files have been copied to
apps/papra-server/public/ - The
server.servePublicDiroption is set totruein your configuration file
Configuration file not loaded
Section titled “Configuration file not loaded”Papra looks for configuration files in the following order:
papra.config.yamlpapra.config.jsonpapra.config.ts
Make sure your configuration file is in the apps/papra-server/ directory and has the correct filename.