Skip to content
DemoFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

Launch and Configuration — Self-hosted Deployment ​

Launch and Configuration: ComPDF AMI (AWS Marketplace / EC2) ​

This page provides the complete steps from launching the AMI in AWS Marketplace to having the service available.


1. Prerequisites ​

1.1 Obtain a License Key (Required) ​

Please prepare your LICENSE_KEY in advance.

For getting or purchasing your license, feel free to contact our sales team.

1.2 Minimum EC2 Specification ​

  • Minimum recommendation: 4 vCPU / 8 GiB RAM
  • SSD (gp3) is recommended, and reserve enough disk space for temporary files and output files

2. Launch the AMI from AWS Marketplace (EC2) ​

  1. Subscribe to the product in AWS Marketplace
  2. Click Launch to enter the EC2 launch workflow
  3. Select/confirm:
    • Instance type: Recommended not lower than 4 vCPU / 8 GiB RAM
    • Key pair: Used for SSH login

2.1 Security Group Inbound Rules (Key) ​

Allow at least:

  • 22/tcp (SSH): Used for login, configuration, and operations (recommended to restrict source IPs)
  • 7000/tcp (HTTP API): Provides the external service (open as needed to the calling clients)

Optional:

  • 3306/tcp (MySQL): Decide whether to open it based on your access needs (if not required, it is not recommended to expose it to the public Internet)

3. SSH into the Instance (username: ubuntu) ​

After the instance starts, log in via SSH:

bash
ssh -i /path/to/your-key.pem ubuntu@<EC2_PUBLIC_IP>

4. Configure the License Key ​

4.1 Locate the Configuration File ​

This AMI comes with Docker / Docker Compose pre-installed. You only need to modify the Docker Compose configuration file and start the service.

Docker Compose file path:

  • /var/www/compdf/docker-compose.yml

4.2 Edit and Replace LICENSE_KEY ​

bash
sudo vi /var/www/compdf/docker-compose.yml

Replace the following:

yaml
LICENSE_KEY: your LICENSE_KEY

With your actual License Key, for example:

yaml
LICENSE_KEY: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Save and exit.


5. Start the Service ​

Docker / Docker Compose is pre-installed in the AMI. Run the following command to start the service:

bash
cd /var/www/compdf
sudo docker compose up -d

This will start two containers:

  • compdfkit_processor: Conversion service (exposes port 7000)
  • dbmysql: MySQL database

6. Verify the Service is Running ​

6.1 Check Container Status ​

bash
sudo docker ps

You should see:

  • compdfkit_processor
  • dbmysql

6.2 View Logs (for troubleshooting) ​

bash
sudo docker logs -f compdfkit_processor

Database logs:

bash
sudo docker logs -f dbmysql

7. Stop / Restart ​

Stop:

bash
cd /var/www/compdf
sudo docker compose down

Start:

bash
cd /var/www/compdf
sudo docker compose up -d