How to Install Stirling PDF on Ubuntu 24.04 VPS for Private Document Management

Introduction

In today's digital landscape, managing sensitive documents securely is more important than ever. If you're looking to set up a private document management system on your Ubuntu 24.04 VPS, Stirling PDF offers a robust solution. At ByteHosting, we understand the importance of reliable and secure hosting, which is why we guide you through the process of installing Stirling PDF on Ubuntu VPS using Docker. This approach ensures an easy, containerized deployment that is both scalable and maintainable.

Prerequisites: Setting Up Your Ubuntu 24.04 VPS and Installing Docker

1. Choose and Deploy Your VPS

First, you need a fresh Ubuntu 24.04 VPS. We recommend selecting one of our cost-effective KVM-based VPS plans in Frankfurt am Main, which provides excellent connectivity and performance. Once your VPS is ready, connect via SSH:

ssh username@your-vps-ip

2. Update Your System

Before installing Docker, ensure your system is up to date:

sudo apt update && sudo apt upgrade -y

3. Install Docker

Docker is essential for containerized deployment. Install Docker using the official convenience script:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Verify the installation:

docker --version

Downloading and Running Stirling PDF Container with Docker Compose

1. Install Docker Compose

Docker Compose simplifies managing multi-container applications. Install it with:

sudo apt install docker-compose -y

2. Create a Docker Compose File for Stirling PDF

Next, create a directory for your Stirling PDF setup and navigate into it:

mkdir stirling-pdf && cd stirling-pdf

Now, create a docker-compose.yml file:

nano docker-compose.yml

Insert the following configuration, which pulls the latest Stirling PDF image and sets up necessary ports and volumes:

version: '3'
services:
  stirling:
    image: stirlingpdf/stirling:latest
    container_name: stirling_pdf
    ports:
      - "8080:8080"
    volumes:
      - ./data:/app/data
    environment:
      - STIRLING_SECRET_KEY=your-secret-key

Replace your-secret-key with a strong, unique key for secure access.

3. Launch Stirling PDF

Start the container with:

docker-compose up -d

This command downloads the Stirling PDF image and runs it in detached mode. Your server now hosts Stirling PDF accessible via port 8080.

Configuring Stirling PDF for Secure Access and Storage

1. Secure Your Installation

For production, it's crucial to secure your Stirling PDF instance. Consider setting up a reverse proxy with SSL using Nginx. Here's a quick overview:

  • Install Nginx:
  • Obtain an SSL certificate with Let's Encrypt:
  • Configure Nginx to proxy requests to your Stirling container and enforce HTTPS.
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com
sudo apt install nginx -y

2. Persistent Storage

Ensure your data persists by mapping a local directory to the container's data directory, as shown in the Docker Compose file. This way, your documents are safe even if the container restarts.

Testing Your Stirling PDF Setup

Once everything is running, open your browser and navigate to http://your-vps-ip:8080. You should see the Stirling PDF interface. Upload a test document to verify that uploads, storage, and retrieval work correctly.

Troubleshooting Common Issues

  • Container not starting: Check logs with docker logs stirling_pdf. Ensure Docker is running and ports are not blocked by firewalls.
  • Cannot access Stirling PDF: Verify your server's firewall settings and ensure port 8080 (or your custom port) is open.
  • SSL issues: Confirm your SSL certificates are valid and Nginx configuration is correct.

Conclusion

Deploying Stirling PDF on your Ubuntu 24.04 VPS is straightforward with Docker and Docker Compose. By following this guide, you can set up a secure, private document management system tailored to your needs. At ByteHosting, we provide reliable VPS hosting in Frankfurt am Main, perfect for hosting applications like Stirling PDF. Whether you're managing sensitive files or building a private portal, our infrastructure supports your goals with high uptime and excellent performance. If you need a VPS to get started, explore our plans and experience the benefits of enterprise-grade hosting today.

Read more