blog
  • Blogs
    • Medium Articles
      • Linux
        • 40 Powerful Linux Networking Commands You Must Know.
        • These (Linux) VI Editor Shortcuts You Must Know
        • Bash/Linux Interview Questions for DevOps Engineers
        • Page 1
      • Git
        • 40 Powerful Git Commands Every Developer Should Know
        • 10 Git Best Practices That Every Developer Must Know
      • DevOps/SRE Interview Questions and Answers
        • Top DevOps/SRE Interview Questions and Answers on AWS VPC
        • Top 10 Common DevOps/SRE Interview Questions and Answers on Terraform Best Practices
        • Top 10 Common DevOps/SRE Interview Questions and Answers on Kubernetes Best Practices
        • Top 10 Common DevOps/SRE Interview Questions and Answers on Dockerfiles
        • Top 10 Common DevOps/SRE Interview Questions and Answers on Grafana
      • Installation
        • Docker Installation on Ubuntu 20/22
        • Install WireGuard VPN on Docker Compose
        • Install Redis on Docker Compose
        • Gravitee Docker Compose
      • Kubernetes Series 2025
        • Understanding Kubernetes: Part 1 -Control Plane
        • Understanding Kubernetes: Part 2 -Worker Node
        • Understanding Kubernetes: Part 3 -Pod
        • Understanding Kubernetes: Part 4-ReplicaSets
        • Understanding Kubernetes: Part 5 -Deployment
        • Understanding Kubernetes: Part 6 -DaemonSets
        • Understanding Kubernetes: Part 7 -StatefulSet
        • Understanding Kubernetes: Part 8 -ConfigMap
        • Understanding Kubernetes: Part 9 -Kubernetes Secret
        • Understanding Kubernetes: Part 10 -StorageClass
        • Understanding Kubernetes: Part 11 -Persistent Volume (PV)
        • Understanding Kubernetes: Part 12 -Persistent Volume Claim (PVC)
        • Understanding Kubernetes: Part 13 -Services
        • Understanding Kubernetes: Part 14 -ClusterIP Service
        • Understanding Kubernetes: Part 15 -NodePort Service
        • Understanding Kubernetes: Part 16 -Load Balancer Service
        • Understanding Kubernetes: Part 17 -Ingress
        • Understanding Kubernetes: Part 18 -Ingress Controller
        • Understanding Kubernetes: Part 19 -Headless Service
        • Understanding Kubernetes: Part 20-Network Policy
        • Understanding Kubernetes: Part 21 -CNI
        • Understanding Kubernetes: Part 22 Kubernetes Resource Requests & Limits
        • Understanding Kubernetes: Part 23 Node Selector
        • Understanding Kubernetes: Part 24 Taints and Tolerations
        • Understanding Kubernetes: Part 25 Affinity and Anti-Affinity
        • Understanding Kubernetes: Part 26 Preemption and Priority
        • Understanding Kubernetes: Part 27 Role and RoleBinding
        • Understanding Kubernetes: Part 28 ClusterRole and ClusterRoleBinding
        • Understanding Kubernetes: Part 29 Service Account
        • Understanding Kubernetes: Part 30 Horizontal Pod Autoscaler (HPA)
        • Understanding Kubernetes: Part 31 Vertical Pod Autoscaler (VPA)
        • Understanding Kubernetes: Part 33 Startup Probe
        • Understanding Kubernetes: Part 34 Liveness Probe
        • Understanding Kubernetes: Part 35 Readiness Probe
        • Understanding Kubernetes: Part 36 Container Network Interface (CNI)
        • Understanding Kubernetes: Part 37 Container Runtime Interface (CRI)
        • Understanding Kubernetes: Part 38 Container Storage Interface (CSI)
      • Cloudflare
        • Cloudflare Tunnel for Secure HTTP Routing
      • Nginx
        • Nginx use cases that every engineer must know
Powered by GitBook
On this page
  • Setting up Gravitee API Platform Using Docker Compose with Nginx Proxy and SSL
  • Prerequisites
  • Installing Docker and Docker Compose
  • Setting Up Gravitee API Management Platform
  • Setting Up Nginx and Certbot for SSL
  • Updating Gravitee Docker Compose Configuration
  • Final URLs
  1. Blogs
  2. Medium Articles
  3. Installation

Gravitee Docker Compose

Setting up Gravitee API Platform Using Docker Compose with Nginx Proxy and SSL

In this guide, we’ll walk through the process of setting up the Gravitee API Management Platform using Docker Compose, Nginx as a reverse proxy, and SSL secured with Certbot on Ubuntu 22.04.


Prerequisites

Ensure the following tools are installed on your system:

  • Docker

  • Docker Compose

  • Nginx

  • Certbot

  • OS: Ubuntu 22.04


Installing Docker and Docker Compose

Install Docker

  1. Update existing packages:

    sudo apt update
  2. Install prerequisite packages for HTTPS access:

    sudo apt install apt-transport-https ca-certificates curl software-properties-common
  3. Add GPG key for the Docker repository:

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  4. Add Docker repository to APT sources:

    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] 
    https://download.docker.com/linux/ubuntu
     $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null


5. **Update package list**:

sudo apt update
  1. Install Docker:

    sudo apt install docker-ce
  2. Check Docker status:

    sudo systemctl status docker

Install Docker Compose

  1. Download Docker Compose:

    mkdir -p ~/.docker/cli-plugins/
    curl -SL https://github.com/docker/compose/releases/download/v2.3.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
  2. Set permissions:

    chmod +x ~/.docker/cli-plugins/docker-compose
  3. Check Docker Compose version:

    docker compose version

Setting Up Gravitee API Management Platform

  1. Create a folder for Gravitee:

    mkdir Gravitee
    cd Gravitee
  2. Download the Docker Compose file:

    curl https://raw.githubusercontent.com/gravitee-io/gravitee-docker/master/apim/3.x/docker-compose.yml -o docker-compose.yml
  3. Update the Docker Compose file: Replace localhost with your server's public IP address:

    PORTAL_API_URL=http://<PUBLIC-IP>:8083/portal/environments/DEFAULT
    MGMT_API_URL=http://<PUBLIC-IP>:8083/management/organizations/DEFAULT/environments/DEFAULT/
  4. Start Gravitee services:

    docker compose up -d
  5. Verify containers are running:

    docker ps

Access Gravitee Services

  • API Management: http://<SERVER-IP>:8084

  • API Portal: http://<SERVER-IP>:8085

Default Login Credentials:

  • Username: admin

  • Password: admin


Setting Up Nginx and Certbot for SSL

Install Certbot and Nginx

  1. Install Certbot:

    sudo apt install certbot python3-certbot-nginx
  2. Install Nginx:

    sudo apt install nginx -y
  3. Start and verify Nginx:

    sudo systemctl start nginx
    sudo systemctl status nginx

Configure Nginx for Gravitee Services

  1. Navigate to the Nginx sites-available directory:

    cd /etc/nginx/sites-available
  2. Create configuration files: For each service, create a new Nginx configuration file. Replace portal.domain.com, gravitee-api.domain.com, and other domains with your actual domains.

Example: portal.conf for the Gravitee API Portal (port 8085):

server {
    server_name portal.domain.com;

    location / {
        proxy_pass http://127.0.0.1:8085;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $http_host;
        proxy_read_timeout    300s;
        proxy_send_timeout    300s;
        proxy_connect_timeout 300s;

        add_header X-XSS-Protection "1; mode=block";
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
        add_header X-Content-Type-Options nosniff;
        add_header X-Robots-Tag none;
        add_header Content-Security-Policy "upgrade-insecure-requests; ";

        autoindex off;
    }
}
  1. Repeat for other services:

    • api.conf (Management API, port 8083)

    • apim.conf (API Management UI, port 8084)

    • gateway.conf (Gateway API, port 8082)

  2. Enable configurations:

    ln -s /etc/nginx/sites-available/portal.conf /etc/nginx/sites-enabled/portal.conf
    ln -s /etc/nginx/sites-available/api.conf /etc/nginx/sites-enabled/api.conf
    ln -s /etc/nginx/sites-available/apim.conf /etc/nginx/sites-enabled/apim.conf
    ln -s /etc/nginx/sites-available/gateway.conf /etc/nginx/sites-enabled/gateway.conf

Add Domains to DNS Record

Add DNS records:

  • portal.domain.com

  • gravitee-api.domain.com

  • gateway.domain.com

Obtain SSL Certificates

Run Certbot to obtain SSL certificates for each domain:

sudo certbot --nginx -d portal.domain.com -d gravitee-api.domain.com -d gateway.domain.com

Updating Gravitee Docker Compose Configuration

  1. Stop Gravitee services:

    docker compose down
  2. Update docker-compose.yml: Replace the URLs with the secured domains:

    MGMT_API_URL=https://gravitee-api.domain.com/management/organizations/DEFAULT/environments/DEFAULT/
    PORTAL_API_URL=https://portal.domain.com/portal/environments/DEFAULT
  3. Restart Gravitee services:

    docker compose up -d

Final URLs

  • Gravitee API Management UI: https://gravitee.domain.com

  • Gravitee API Portal UI: https://portal.domain.com

  • Gravitee Backend API: https://gravitee-api.domain.com

  • Gravitee Gateway API: https://gateway.domain.com

Your Gravitee API Management Platform is now up and running with secure SSL connections!

PreviousInstall Redis on Docker ComposeNextKubernetes Series 2025

Last updated 5 months ago

Reference: How to Install Docker on Ubuntu 22.04
Reference: How to Install Docker Compose on Ubuntu 22.04
Reference: Gravitee API Platform Documentation