> 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/aws/hivel-on-premises-deployment-guide-aws/deployment-methods/method-1-using-deploy.sh-script-recommended.md).

# Method 1: Using deploy.sh Script (Recommended)

On-prem Deployment Guide (AWS)

**Goal:** Deploy all Hivel VM services using an automated script.

**Prerequisites:**

* Database Migration completed successfully
* `.env` file configured with application user credentials (DB\_USER and DB\_PASSWORD)
* Docker and Docker Compose installed on VM
* AWS ECR access configured (IAM role or AWS CLI credentials)

### Deploy All Services

**Application/System:** EC2 VM (Docker)

**On your EC2 VM, run:**

```
cd /opt/hivel-onprem

# Deploy all VM services
./deploy.sh --vm
```

#### (OR)

### Deploy Specific Services

**If you need to deploy only certain services instead of all:**

{% hint style="info" %}
**contact Hivel** [**support@hivel.ai**](mailto:support@hivel.ai) **for more info on deploying a specific service and list of services.**
{% endhint %}

### Available deploy.sh Commands

```
# Deploy all services (VM on same instance)
./deploy.sh --all

# Deploy VM services 
./deploy.sh --vm

# Deploy specific service
./deploy.sh --service <service-name>

# Check service status
./deploy.sh --status

# Check service health
./deploy.sh --health

# View logs
./deploy.sh --logs
./deploy.sh --logs <service-name>

# Start services
./deploy.sh --start

# Stop services
./deploy.sh --stop

# Restart services
./deploy.sh --restart

# Update services (pull latest images)
./deploy.sh --update

# List all services
./deploy.sh --list

# Show help
./deploy.sh --help

```

#### Troubleshooting

* **Services fail to start:** Check `.env` file has correct database credentials and RDS is reachable
* **Image pull fails:** Verify AWS ECR credentials and access
* **Health checks fail:** Review logs with `./deploy.sh --logs <service-name>`

See [Troubleshooting](https://docs.hivel.ai/self-managed-hivel-deployment/virtual-private-cloud/aws/hivel-on-premises-deployment-guide-aws/troubleshooting) for detailed solutions.

{% columns %}
{% column %} <a href="/self-managed-hivel-deployment/virtual-private-cloud/aws/hivel-on-premises-deployment-guide-aws/deployment-methods.md" class="button primary" data-icon="backward">Deployment Methods</a>
{% endcolumn %}

{% column %}

{% endcolumn %}

{% column %} <a href="/self-managed-hivel-deployment/virtual-private-cloud/aws/hivel-on-premises-deployment-guide-aws/deployment-methods/method-2-deployment-using-docker-compose.md" class="button primary" data-icon="forward">Method 2: Docker Compose</a>
{% endcolumn %}
{% endcolumns %}
