> 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/on-premises-generic/hivel-on-premises-deployment-guide-generic.md).

# Hivel On-Premises Deployment Guide (Generic)

Complete step-by-step guide for deploying Hivel services on prem.

{% hint style="warning" %}
**Important**:

All registry credentials, database passwords, and application passwords in this guide are <mark style="background-color:$info;">**placeholders**</mark>. Generate your own credentials using <mark style="color:$warning;">`openssl rand -base64 24`</mark> and store them in a secrets manager. Never reuse example credentials in production.
{% endhint %}

<table data-search="false"><thead><tr><th width="286.23046875">Page</th><th>Description</th></tr></thead><tbody><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/overview.md"><strong>Overview</strong></a></td><td><strong>Review the host-Docker architecture</strong> (API Gateway, Services, integration connectors, self-managed PostgreSQL) and confirm on-premises deployment is the right choice for your environment.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/server-infrastructure-setup.md"><strong>Server Infrastructure Setup</strong></a></td><td><strong>Verify host sizing specifications</strong>, confirm open ports, and install Docker, Docker Compose, and AWS CLI on the host.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/prerequisites.md"><strong>Prerequisites</strong></a></td><td><strong>Confirm all prerequisites:</strong> required servers, license files, registry/S3 access credentials, compatible software versions, and full inbound/outbound network access per requirements.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/database-setup-self-managed-postgresql.md"><strong>Database Setup (Self-Managed PostgreSQL)</strong></a></td><td><strong>Install PostgreSQL</strong>, set the superuser password, open database access from the host, and create the <code>insightly</code> application database.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/project-setup.md"><strong>Project Setup</strong></a></td><td><strong>Download the <code>hivel-onprem</code> package</strong> from S3 to the host and add license files to the project directory.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/registry-access-configuration.md"><strong>Registry Access Configuration</strong></a></td><td><strong>Configure AWS CLI credentials</strong> on both hosts and authenticate to Hivel's ECR image registry (or optional private registry mirror).</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/environment-configuration.md"><strong>Environment Configuration</strong></a></td><td><strong>Create and configure the <code>.env</code> file</strong> with superuser credentials (for initial setup) and application-user credentials (for runtime), applying correct password-quoting rules.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/database-migration.md"><strong>Database Migration</strong></a></td><td><strong>Run the Flyway migration</strong> on the host to initialize the schema and create the application database user.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/deployment.md"><strong>Deployment</strong></a></td><td><strong>Deploy services using <code>./deploy.sh</code></strong> (recommended). This handles image pulls, startup ordering, health checks, and logging; see command reference for options.</td></tr><tr><td>↳ <a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/deployment/method-1-deploy.sh-recommended.md"><code>deploy.sh</code> (Recommended)</a></td><td><strong>Deploy services using <code>./deploy.sh --vm</code> or <code>./deploy.sh --service</code></strong> (recommended). This handles image pulls, startup ordering, health checks, and logging; see full command reference for all available options.</td></tr><tr><td>↳ <a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/deployment/method-2-docker-compose-directly.md">Docker Compose Directly</a></td><td><strong>Deploy services using <code>./deploy.sh --vm</code> or <code>./deploy.sh --service</code></strong> (recommended). This handles image pulls, startup ordering, health checks, and logging; see full command reference for all available options. Alternatively, manually create the shared Docker network and run <code>docker-compose</code> per host/service for finer-grained control.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/log-rotation-setup.md"><strong>Log Rotation Setup</strong></a></td><td><strong>Set up daily log rotation</strong> with 7-day retention across all containers.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/verification-and-access.md"><strong>Verification and Access</strong></a></td><td><strong>Verify installation is complete:</strong> confirm all services pass health checks, complete the validation checklist, and confirm UI access via direct IP, your reverse proxy, or Caddy.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/application-setup-guide-user-sign-up-and-integration.md"><strong>Application Setup Guide: User Sign-up and Integration</strong></a></td><td><strong>Complete initial application setup:</strong> create user account, configure organization, and integrate essential external tools.</td></tr><tr><td><strong>ADVANCED</strong></td><td></td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/https-setup-with-caddy-optional.md"><strong>HTTPS Setup with Caddy (Optional)</strong></a></td><td><strong>Set up Caddy reverse proxy</strong> for automatic HTTPS via Let's Encrypt or self-signed certificate, including management and troubleshooting.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/file-locations-quick-reference.md"><strong>File Locations Quick Reference</strong></a></td><td><strong>Reference file locations</strong> for config, license, Docker Compose, and log files.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/troubleshooting.md"><strong>Troubleshooting</strong></a></td><td><strong>Troubleshoot deployment issues</strong> using symptom-cause-diagnostic-resolution guide for service startup, database connection, registry pull, migration, credentials, ports, health checks, and log rotation.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/backup-and-restore.md"><strong>Backup and Restore</strong></a></td><td><strong>Back up and restore the <code>insightly</code> database</strong> using <code>pg_dump</code>/<code>pg_restore</code>, including post-restore permissions re-evaluation.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/upgrade-and-rollback.md"><strong>Upgrade and Rollback</strong></a></td><td><strong>Upgrade to new image versions</strong> or roll back; note that Flyway migrations are not easily reversible.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/uninstall-and-cleanup.md"><strong>Uninstall and Cleanup</strong></a></td><td><strong>Uninstall and clean up:</strong> back up data, stop/remove services, decommission hosts, clean infrastructure, and revoke all credentials.</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/security-and-secrets.md"><strong>Security and Secrets</strong></a></td><td><strong>Secure credentials and rotate database passwords</strong> using least-privilege roles (superuser vs. application-user).</td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/support-handoff.md"><strong>Support Handoff</strong></a></td><td><p></p><p>Before Contacting Support,</p><p><strong>collect required information:</strong> status/health output, container logs, redacted <code>.env</code> file, software versions, and timestamps.</p></td></tr><tr><td><a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/deployment-checklist.md"><strong>Deployment Checklist</strong></a></td><td><strong>Complete the deployment checklist</strong> confirming all steps above before moving to Integration Setup.</td></tr></tbody></table>

{% columns %}
{% column %} <a href="/self-managed-hivel-deployment/on-premises-generic/tl-dr-on-premises.md" class="button primary" data-icon="backward">Back to TL;DR (On-Premises)</a>
{% endcolumn %}

{% column %}

{% endcolumn %}

{% column %} <a href="/self-managed-hivel-deployment/on-premises-generic/hivel-on-premises-deployment-guide-generic/overview.md" class="button primary" data-icon="forward">Overview</a>
{% endcolumn %}
{% endcolumns %}
