Back to articles
DevOps & Systems

Guide to Setting Up a Private Ads Server with Keitaro on VPS for Businesses

This comprehensive guide details how to deploy a private ads server using Keitaro on a VPS, covering Docker setup, Nginx reverse proxy, database configuration, and enterprise-grade...

DPTCloud Engineering4 min read
Guide to Setting Up a Private Ads Server with Keitaro on VPS for Businesses

This comprehensive guide details how to deploy a private ads server using Keitaro on a VPS, covering Docker setup, Nginx reverse proxy, database configuration, and enterprise-grade security. It follows DevOps automation principles and integrates centralized management tools like ELK Stack and CrowdSec for scalable, secure operations.

Introduction to Private Ads Server with Keitaro

A private ads server enables businesses to manage advertising campaigns internally, offering full control over user data, ad delivery, and operational costs. Keitaro is a powerful advertising management platform that supports automation, real-time analytics, and performance optimization. Deploying Keitaro on a VPS allows enterprises to host their infrastructure privately, ensuring high security, compliance, and flexibility.

Provisioning a Suitable VPS Environment

To run Keitaro effectively, select a VPS with the following minimum specifications:

  • RAM: 4GB or higher
  • Storage: 50GB NVMe
  • OS: Ubuntu 20.04 LTS or 22.04 LTS

For high-performance requirements, consider NVMe Cloud VPS for Docker, Nginx & Databases to ensure optimal resource allocation.

Installing and Configuring Keitaro

Keitaro can be deployed using Docker for streamlined setup. Follow these steps:

# Install Docker
sudo apt update
sudo apt install docker.io docker-compose -y

# Create data storage directory
mkdir -p ~/keitaro/data
cd ~/keitaro

# Create docker-compose.yml
cat <<EOF > docker-compose.yml
version: '3.8'

services:
  keitaro:
    image: keitaro/keitaro:latest
    container_name: keitaro
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./data:/var/www/html/data
    environment:
      - [email protected]
      - KEITARO_ADMIN_PASSWORD=yourpassword
    restart: unless-stopped
EOF

# Start the service
docker-compose up -d

Setting Up Nginx as a Reverse Proxy

Use Nginx as a reverse proxy to enhance security and performance:

server {
    listen 80;
    server_name ads.yourdomain.com;

    location / {
        proxy_pass http://localhost:80;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }

    location /admin {
        proxy_pass http://localhost:80;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

Apply the configuration and restart Nginx:

sudo systemctl restart nginx

Management and Security

Ensure security and centralized monitoring with the following tools:

Testing and Verification

After installation, verify functionality by accessing https://ads.yourdomain.com and logging in with the admin credentials. Confirm:

  • The admin panel loads correctly
  • Ad campaign creation and management functions work
  • Reverse proxy routes are properly handled

Troubleshooting

If issues arise:

  • Keitaro fails to start: Check logs using docker-compose logs keitaro
  • Access via Nginx fails: Verify Nginx configuration and ensure ports 80/443 are open
  • SMTP email delivery fails: Validate SMTP settings in the .env file

References

Additional resources:

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478