> For the complete documentation index, see [llms.txt](https://docs.hivel.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hivel.ai/self-managed-hivel-deployment/virtual-private-cloud/azure/hivel-on-premises-deployment-guide-azure/deployment-methods/method-2-deployment-using-docker-compose.md).

# Method 2: Deployment Using Docker Compose

On-Prem Deployment Guide (Azure)

Choose this option only when you need finer-grained control over container startup than deploy.sh gives you (e.g. custom orchestration, staged rollouts). This path requires you to manage the shared Docker network and per-service ordering yourself.

### Step 1: Authenticate with ECR

**On the VM:**

```
# Authenticate with ECR
aws ecr get-login-password --region ap-south-1 | \
  docker login --username AWS --password-stdin \
  730335373269.dkr.ecr.ap-south-1.amazonaws.com
```

**If using your own ECR:**

```
aws ecr get-login-password --region YOUR_REGION | \
  docker login --username AWS --password-stdin \
  YOUR_ACCOUNT.dkr.ecr.YOUR_REGION.amazonaws.com
```

### Step 2: Create Docker Network

**On the VM:**

```
docker network create microservices_network
```

### Step 3: Deploy VM Services

**On VM only:**

```
cd /opt/hivel-onprem/services/vm
 
# Pull all images
docker-compose --env-file ../../config/.env pull
 
# Deploy all services
docker-compose --env-file ../../config/.env up -d
 
# Or deploy specific service
docker-compose --env-file ../../config/.env up -d auth-svc
```

### Docker Compose Management Commands

```
# View running services
docker-compose ps
 
# View logs
docker-compose logs -f
docker-compose logs -f <service-name>
 
# Stop services
docker-compose stop
 
# Start services
docker-compose start
 
# Restart services
docker-compose restart
 
# Remove services
docker-compose down
 
# Update services
docker-compose pull
docker-compose up -d

```

**Next step:** Log Rotation Setup.

{% columns %}
{% column %} <a href="/self-managed-hivel-deployment/virtual-private-cloud/azure/hivel-on-premises-deployment-guide-azure/deployment-methods/method-1-deployment-using-deploy.sh-script.md" class="button primary" data-icon="backward">Method 1: deploy.sh Script</a>
{% endcolumn %}

{% column %}

{% endcolumn %}

{% column %} <a href="/self-managed-hivel-deployment/virtual-private-cloud/azure/hivel-on-premises-deployment-guide-azure/log-rotation-setup.md" class="button primary" data-icon="forward">Log Rotation Setup</a>
{% endcolumn %}
{% endcolumns %}
