⚙️Advanced Setup
In this section, you’ll set up your PayRam server using Docker, covering installation, security configuration, and encryption to ensure your server is fully prepared and running smoothly.
Docker installation
PayRam can be run using Docker, which provides a clean, isolated environment and avoids operating system or tooling incompatibilities. It also makes managing the database and environment variables simple and straightforward.
You can run PayRam inside a Docker container in any os with a simple command, either on testnet for development or on mainnet for production.
Technical knowledge requirements for self-hosting
Running PayRam on your own servers requires understanding of technical concepts such as:
Installing and managing Docker containers
Allocating system resources effectively
Securing servers and sensitive data
Configuring environment variables and application settings correctly
Incorrect setup can result in data loss, security risks, or downtime.
Hardware requirements
Server configuration
Use a VPS or dedicated server with the minimum specifications required to host the PayRam server.
Minimum server requirements:
CPU: 2 cores
RAM: 4 GB
Storage: 50 GB SSD
Operating System: Ubuntu 22.04
Network requirements
Ensure the following ports are open on your server or VPS:
PortPurpose80
HTTP. Serves the dashboard, payment pages, and API. Redirects to 443 when SSL is enabled.
443
HTTPS. Required only when PayRam terminates TLS itself (Let's Encrypt or custom certificates).
Quick start
Use this guide to run PayRam with Docker on testnet for local setup and testing. See below for instructions on deploying PayRam in production on the mainnet.
Assuming you have Docker installed and running, pull the latest PayRam image and start a container
Create a folder where PayRam should store its data, logs, and database files, then point
WORKDIRat it. Choose any location you like — just keep it the same across updates.Generate your own
AES_KEY. This encrypts your hot wallet keys, so never reuse a key from the docs or from anyone else.
This command does the following:
Runs PayRam in the background (-d) with the name payram-testnet.
Exposes ports:
80 → HTTP access to the dashboard, payment pages, and API
Sets environment variables:
AES_KEY: Encryption key used for securing data.
SSL_CERT_PATH: Path to SSL certificates (optional in testnet).
BLOCKCHAIN_NETWORK_TYPE: Configures the blockchain network (testnet).
SERVER: Marks the environment as DEVELOPMENT.
POSTGRES_*: Database connection details.
Mounts volumes:
$WORKDIR:/root/payram → Application data.
$WORKDIR/log/supervisord:/var/log → Log files.
$WORKDIR/db/postgres:/var/lib/payram/db/postgres → Database storage.
Pulls and runs the PayRam Docker image: payramapp/payram:latest (or payramapp/payram:latest-arm64 on ARM).
Advance setup
If you’re running PayRam in production, keep the following in mind: you need to configure an external database, set up proper SSL certificates, and generate your own unique AES key for security.
AES key generation
A secure encryption key required by PayRam.
Generate it the same way as in Quick start, and use a fresh key for production — never reuse the one from your testnet instance.
Postgres setup
To run PayRam safely and reliably in a production environment, you must connect it to an external PostgreSQL database hosted by a trusted and managed provider. Local or containerized databases should not be used in production, as they are not secure, scalable, or fault-tolerant.
Recommended PostgreSQL providers include:
Amazon RDS for PostgreSQL / Aurora PostgreSQL
Google Cloud SQL for PostgreSQL
Azure Database for PostgreSQL
DigitalOcean Managed PostgreSQL
Required environment variables
When your provider gives you a connection URL, simply take each part of it and map it to PayRam’s required environment variables.
The following example shows how this connection URL can be expressed as environment variables for PayRam:
SSL configuration
PayRam requires SSL/TLS certificates to enable secure HTTPS connections in production.
If you are using a third-party provider such as Cloudflare or AWS Load Balancer that manages HTTPS for you, you can leave this value empty:
If you are managing certificates yourself on the PayRam server, you must point this variable to the directory where your domain’s SSL/TLS certificates are stored.
The most common setup is with Let’s Encrypt, which stores certificates in:
Ensure the directory contains the correct certificate files for your domain (commonly fullchain.pem and privkey.pem).
Production setup
Before starting PayRam for the first time, make sure you note down and store all necessary configurations securely. These will be required for future updates or troubleshooting:
AES_KEY → Keep a copy of the key securely; required for decrypting data in future updates.
Postgres details → Database name, username, password, and port. You will need the same details to reconnect or update.
Volume paths (WORKDIR) → Note the host paths you plan to use for data, logs, and database files (e.g.,
/home/payram). These must remain consistent for updates
What does this command do?
Runs PayRam on mainnet in a Docker container.
Maps and exposes ports:
80 → standard HTTP (redirects to 443 when SSL is enabled)
443 → HTTPS (requires valid SSL certs)
⚠️ Important on HTTPS:
If you set SSL_CERT_PATH and mount certs, HTTPS on 443 will work and PayRam will serve securely.
If you leave SSL_CERT_PATH="", PayRam will only serve over HTTP. This is acceptable if you use an external TLS termination service (like Cloudflare, reverse proxy, or load balancer).
Configures environment variables:
AES_KEY must be a secure random hex string in production.
SERVER=PRODUCTION ensures PayRam runs in production mode.
Postgres settings must point to your production-grade database.
Mounts volumes:
$WORKDIR:/root/payram → application data.
$WORKDIR/log/supervisord:/var/log → logs.
$WORKDIR/db/postgres:/var/lib/payram/db/postgres → Postgres storage (only if self-hosted).
/etc/letsencrypt:/etc/letsencrypt → host SSL certs (required if SSL_CERT_PATH is set).
Updating PayRam Docker container
Prepare before updating
Before stopping or removing any containers, make sure you note down all current configurations:
AES_KEY → Must be the same as the current container, otherwise PayRam will fail to decrypt data.
Postgres details → Database name, username, password, and port must remain the same.
Volume mappings → Use the exact same host paths to persist data ($WORKDIR, $WORKDIR/log/supervisord, $WORKDIR/db/postgres).
SSL_CERT_PATH → Keep the same configuration (empty for testnet, or set if using SSL).
Network type and SERVER environment → Must be the same as the current container (testnet & DEVELOPMENT, mainnet & PRODUCTION) or it will cause issues.
Done! All your data and configurations are preserved while updating PayRam.
Last updated