If you're a Laravel developer, there's a good chance you've used [Laravel Forge](https://forge.laravel.com) to provision and manage your servers. Forge is excellent at what it does — spinning up a fully configured server with Nginx, PHP, MySQL, Redis, and SSL in under a minute.

But once your server is running, how does your code actually get there?

Forge includes a basic push-to-deploy feature, but as your application grows — multiple environments, build steps, team workflows — you may find yourself wanting more control over the deployment process itself. That's where [DeployHQ](https://www.deployhq.com) comes in.

This guide breaks down what each tool does, where they overlap, and how to use them together for a deployment workflow that covers both server management and code delivery.

## What Laravel Forge Does

Forge is a **server provisioning and management** platform. Its primary job is turning a bare VPS from providers like DigitalOcean, AWS, or Hetzner into a fully configured application server.

What Forge handles:

- **Server provisioning** : One-click setup of Nginx, PHP (multiple versions), MySQL/PostgreSQL, Redis, Memcached
- **SSL certificates** : Free Let's Encrypt certificates with auto-renewal
- **Security** : Firewall configuration, SSH key management, automatic security updates
- **Process management** : Queue workers (Supervisor), cron job scheduling, daemon processes
- **Monitoring** : CPU, memory, and disk usage dashboards
- **Basic deployments** : Push-to-deploy from GitHub, GitLab, or Bitbucket with a configurable deploy script

Forge's deployment feature runs a shell script on your server when you push to a branch. The default script does a `git pull`, runs `composer install`, and restarts PHP-FPM. For simple apps, this works fine.

## What DeployHQ Does

[DeployHQ](https://www.deployhq.com) is a **deployment pipeline** platform. It focuses entirely on getting your code from a repository to one or more servers reliably, with [build pipelines](https://deployhq.com/blog/build-pipelines-in-deployhq-streamline-your-deployment-workflow), atomic releases, and full visibility into what was deployed and when.

What [DeployHQ](https://www.deployhq.com) handles:

- **Build pipelines** : Run `composer install`, `npm run build`, asset compilation, and other build steps on DeployHQ's build servers — not on your production machine
- **Atomic deployments** : Release-based deploys with instant rollback, so a failed deployment never leaves your site in a broken state
- **Multi-server deploys** : Push to staging and production from the same pipeline with different configurations
- **Deployment dashboard** : Visual history of every deployment, with logs, diffs, and status
- **Framework-agnostic** : Works with [PHP](https://deployhq.com/blog/5-powerful-ways-to-deploy-php-applications-with-deployhq), Node.js, Python, Ruby, .NET, and any other stack
- **Integrations** : [Deployment notifications](https://deployhq.com/blog/selectable-deployment-notifications) to Slack, Discord, Teams, plus error tracking and cache purging
- **SSH/SFTP/FTP support** : Deploys to any server you can connect to

## Side-by-Side Comparison

| Capability | Forge | DeployHQ | Both Together |
| --- | --- | --- | --- |
| Server provisioning | Yes — full stack setup | No | Forge provisions, DeployHQ deploys |
| SSL/domain management | Yes | No | Forge handles SSL |
| PHP version management | Yes | No | Forge manages PHP |
| Queue workers / cron | Yes | No | Forge manages processes |
| Build pipeline | No — runs on server | Yes — dedicated build servers | DeployHQ builds, Forge serves |
| Atomic/zero-downtime deploys | Yes (new sites only) | Yes (any project) | DeployHQ handles releases |
| Multi-server deployment | No | Yes | Deploy to staging + production |
| Visual deployment history | Basic | Detailed with logs and diffs | Full visibility via DeployHQ |
| Rollback | Keep last 4 releases | Instant rollback to any release | DeployHQ rollbacks |
| Framework support | PHP-focused | Any language/framework | Full flexibility |
| Third-party integrations | Limited | Extensive (Slack, Discord, Bugsnag, Cloudflare) | DeployHQ integrations |

For a condensed feature-by-feature breakdown, see the [DeployHQ vs Laravel Forge comparison page](https://www.deployhq.com/compare/deployhq-vs-laravel-forge).

## How They Work Together

The ideal setup uses each tool for what it does best: Forge manages your infrastructure, [DeployHQ](https://www.deployhq.com) manages your deployments.

```
flowchart TD
    subgraph Developer
        A["Git Push to GitHub/GitLab"]
    end

    subgraph DeployHQ ["DeployHQ (Build & Deploy)"]
        B["Detect Push"]
        C["Run Build Pipeline"]
        D["composer install"]
        E["npm run build"]
        F["php artisan optimize"]
        G["Deploy via SSH"]
    end

    subgraph Forge ["Forge-Provisioned Server"]
        H["Nginx + PHP-FPM"]
        I["MySQL / PostgreSQL"]
        J["Redis + Queue Workers"]
        K["SSL + Firewall"]
    end

    A --> B
    B --> C
    C --> D --> E --> F --> G
    G --> H
    H --> I
    H --> J
    H --> K
```

## Setting Up DeployHQ With a Forge Server

Here's how to connect [DeployHQ](https://www.deployhq.com) to a server provisioned by Forge.

### Step 1: Provision Your Server on Forge

Create your server on Forge as usual — choose your provider, select your PHP version, and let Forge set up the full stack. Make note of the server's IP address.

### Step 2: Get Your DeployHQ SSH Public Key

In [DeployHQ](https://www.deployhq.com), go to **your project** (or create a new one) and navigate to the **Server** settings. [DeployHQ](https://www.deployhq.com) will show you its SSH public key. Copy it.

### Step 3: Add the SSH Key to Your Forge Server

In Forge, go to your server's **SSH Keys** section and add DeployHQ's public key. This authorizes [DeployHQ](https://www.deployhq.com) to connect and deploy files. For more on SSH key setup, see our guide on [creating SSH keys for DeployHQ](https://deployhq.com/blog/5-ways-to-create-ssh-keys-from-the-command-line-for-deployhq).

### Step 4: Create a DeployHQ Server Entry

Back in [DeployHQ](https://www.deployhq.com), configure the server connection:

- **Protocol** : SSH/SFTP
- **Hostname** : Your Forge server's IP address
- **Port** : 22
- **Username** : `forge` (Forge's default deploy user)
- **Deploy path** : `/home/forge/your-site.com/current` (or your site's root)

### Step 5: Configure Your Build Pipeline

This is where [DeployHQ](https://www.deployhq.com) shines. Instead of running build commands on your production server, configure them in DeployHQ's build pipeline:

```
composer install --no-dev --optimize-autoloader
npm ci
npm run build
```

These run on DeployHQ's build servers, keeping your production server lean.

### Step 6: Configure SSH Commands

Add post-deployment SSH commands to run on your Forge server after files are transferred:

```
cd /home/forge/your-site.com
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan queue:restart
```

### Step 7: Enable Zero-Downtime Deployments

In your [DeployHQ](https://www.deployhq.com) project, enable [atomic deployments](https://deployhq.com/blog/migrate-deployhq-project-to-use-atomic-deployments) for release-based deploys with instant rollback. This pairs well with [database migration strategies for zero-downtime](https://deployhq.com/blog/database-migration-strategies-for-zero-downtime-deployments-a-step-by-step-guide).

### Step 8: Disable Forge's Push-to-Deploy

To avoid double deployments, disable Forge's built-in push-to-deploy feature for this site. Go to your site in Forge, navigate to **Deployments** , and toggle off **Quick Deploy**. [DeployHQ](https://www.deployhq.com) will handle triggering deployments from now on.

## A Complete Laravel Deployment Example

Here's what a full deployment looks like with both tools working together:

```
# Build phase (runs on DeployHQ build servers)
composer install --no-dev --optimize-autoloader --no-interaction
npm ci --production
npm run build

# After deployment (SSH commands on Forge server)
cd /home/forge/your-site.com
php artisan down --retry=60
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan event:cache
php artisan storage:link
php artisan up
php artisan queue:restart
```

With [zero-downtime deployments](https://deployhq.com/blog/zero-downtime-deployments-with-deployhq-a-step-by-step-guide) enabled, the `artisan down`/`up` commands become optional — your users will never see a maintenance page.

## When to Use Forge Alone

Forge's built-in deployment works well if:

- You have a **single server** with a **single environment**
- Your app has **no build step** (no npm, no webpack, no Vite)
- You're comfortable with `git pull` happening directly on your server
- You don't need deployment rollbacks or multi-server deploys

For a straightforward Laravel API or a small site, Forge's push-to-deploy is often enough.

## When to Add DeployHQ

Consider pairing with [DeployHQ](https://www.deployhq.com) when:

- You need **build steps** like `npm run build` or `composer install --no-dev` and don't want them running on production
- You deploy to **multiple servers** (staging, production, or multiple regions)
- You want **visual deployment history** with detailed logs and diffs
- You need **instant rollback** without SSH-ing into your server
- Your team needs **deployment notifications** in Slack, Discord, or Teams
- You work with **multiple frameworks** — not just Laravel — and want a unified deployment tool
- You manage client projects as an [agency](https://deployhq.com/for-agencies) and need consistent workflows across different stacks

For a deeper look at PHP deployment strategies, see our [comparison of PHP application servers](https://deployhq.com/blog/comparing-php-application-servers-in-2025-performance-scalability-and-modern-options).

## Handling Environment Variables

One area that needs attention when using both tools is environment variable management. Forge manages your `.env` file on the server directly — you edit it through Forge's UI.

When [DeployHQ](https://www.deployhq.com) deploys, it should **not overwrite** the `.env` file. Add `.env` to your **excluded files** list in DeployHQ's server configuration. This way, Forge keeps managing your environment secrets while [DeployHQ](https://www.deployhq.com) handles code delivery.

For advanced setups, you can also use [encrypted environment variables with Dotenvx](https://deployhq.com/blog/how-to-deploy-php-applications-with-encrypted-environment-variables-using-dotenvx-and-deployhq) to commit encrypted `.env` files directly to your repository.

## FAQ

### Can I use DeployHQ's build pipeline with Forge's zero-downtime deployments?

It's better to choose one tool for deployment management. If you're using [DeployHQ](https://www.deployhq.com) for deployments, disable Forge's deploy feature and use DeployHQ's atomic deployments instead. Running both will cause conflicts.

### Does DeployHQ replace Forge?

No. They serve different purposes. Forge provisions and manages your server infrastructure (PHP, Nginx, SSL, databases, queues). [DeployHQ](https://www.deployhq.com) handles the deployment pipeline (building, transferring, and releasing code). You still need Forge (or manual server setup) for the server itself.

### What about Laravel Envoyer?

[Envoyer](https://www.deployhq.com/compare/deployhq-vs-envoyer) is Laravel's dedicated zero-downtime deployment tool. It sits between Forge's basic deploys and a full tool like [DeployHQ](https://www.deployhq.com). [DeployHQ](https://www.deployhq.com) offers broader framework support, built-in build pipelines, and more integrations. If you only deploy Laravel apps, Envoyer is a solid option. If you work across multiple stacks, [DeployHQ](https://www.deployhq.com) is more versatile.

### Can I deploy to a Forge server via [FTP](https://deployhq.com/blog/freelance-freedom-ditch-ssh-ftp-for-effortless-deployments-with-deployhq)?

Yes, but SSH/SFTP is recommended. Forge servers come with SSH configured, and DeployHQ's SSH deployment is faster and more secure than FTP. FTP should only be used if SSH is unavailable. If FTP is the only option you have, see [how to deploy to your FTP server from Git with DeployHQ](https://www.deployhq.com/blog/how-to-deploy-to-your-ftp-server-with-git-and-deployhq) for the recommended setup.

### Do I still need to manage SSH keys on Forge?

Yes. You'll add DeployHQ's public SSH key to your Forge server so [DeployHQ](https://www.deployhq.com) can connect. After that, deployments are fully automated — no manual SSH required.

* * *

Ready to level up your Laravel deployment workflow? [Sign up for DeployHQ](https://deployhq.com/signup) and connect it to your Forge servers in minutes. For questions, reach out to [support@deployhq.com](mailto:support@deployhq.com) or find us on [X @deployhq](https://x.com/deployhq).

