# Migrate from Laravel Forge to fortrabbit

Source: https://www.fortrabbit.com/migrate/from-laravel-forge
Published: 2026-10-31
Updated: 2026-10-31


## Migrate from Laravel Forge with a coding agent

Claude Code, Codex, Cursor and other coding agents can run this migration. Paste this prompt into the agent, in the project folder:



```txt
Read https://www.fortrabbit.com/agents.md and set up fortrabbit. Then move this site from Laravel Forge to fortrabbit, following https://www.fortrabbit.com/raw/migrate/from-laravel-forge.md
```

Sign-in happens in the browser, see [agent setup](/agents). The agent needs SSH access to the Forge server to read the settings, dump the database and copy the uploads. The steps below are what the agent follows, and what to do by hand without one. The agent changes nothing on the old host: a person deletes the old setup once the site runs on fortrabbit.

## Forge settings and where they go

| On Forge | On fortrabbit |
| -- | -- |
| Site directory `/home/forge/<domain>` | Git repository, deployed by the [GitHub integration](https://docs.fortrabbit.com/platform/deployment/github-app) |
| `.env`, edited under Site → Settings → Environment | [Environment variables](https://docs.fortrabbit.com/platform/settings/env-vars) in the dashboard |
| Deploy script on the Deployments tab | [Build commands](https://docs.fortrabbit.com/platform/deployment/build-commands) and [post-deploy commands](https://docs.fortrabbit.com/platform/deployment/post-deploy-commands) |
| Processes → Scheduler | [Cron jobs](https://docs.fortrabbit.com/platform/jobs/crons) |
| Background processes and queue workers (Supervisor) | [Workers](https://docs.fortrabbit.com/platform/jobs/workers) |
| MySQL on the server, or on a separate database server | MySQL component |
| `storage` shared between releases | Storage component, files copied with rsync |
| Nginx config per site | None, see the last section |

## 1. Create the app

Create an app in the dashboard with the Laravel software template, or the one matching the framework. Its default domain works with HTTPS right away, so the whole move can be tested before DNS changes. Lower the TTL of the domain's DNS records now, see [migrate to fortrabbit](https://docs.fortrabbit.com/dev/how-to/migrate-to-fortrabbit).

## 2. Copy the settings off Forge

Log in with `ssh forge@<server-ip>`. Forge allows key-based SSH only.

- Open Site → Settings → Environment, or `cat .env` in the site directory. Copy every value except `DB_*`, `APP_URL`, `REDIS_*`, `QUEUE_CONNECTION`, `CACHE_STORE` (or `CACHE_DRIVER`) and `SESSION_DRIVER` into the environment variables of the fortrabbit environment.
- Open the Deployments tab. Lines like `composer install` and `npm run build` go into the build commands, `php artisan migrate --force` and cache commands into the post-deploy commands. Drop the Forge macros `$CREATE_RELEASE()` and `$ACTIVATE_RELEASE()`.
- Open Processes → Scheduler. Each entry becomes one cron job, usually `php artisan schedule:run` every minute.
- Open the background processes. Each `queue:work` or Horizon process becomes a worker.

fortrabbit has no Redis. Set the queue, cache and session drivers to `database` or `file`, see [Laravel queues and scheduler](https://docs.fortrabbit.com/guides/laravel/queues-scheduler).

## 3. Deploy the code

Connect the GitHub repository Forge deploys from to the environment and push. The first deployment runs the build commands.

## 4. Move the database

Check `DB_HOST` in the `.env`. `127.0.0.1` means MySQL runs on the web server, anything else means a separate Forge database server. Dump it over SSH:



```shell
mysqldump -h <DB_HOST> -u forge -p <database> > dump.sql
```

The password is `DB_PASSWORD` in the `.env`. Import the dump into the MySQL component as described under [MySQL export and import](https://docs.fortrabbit.com/platform/mysql/export-import).

## 5. Copy the uploads

Uploaded files sit in `/home/forge/<domain>/storage`, or in `storage/app/public` for the `public` disk. Pull them to the local machine with rsync, then push them to the environment, see [rsync](https://docs.fortrabbit.com/dev/how-to/rsync). Files on S3 stay where they are: keep the bucket credentials in the environment variables.

## 6. Switch the DNS

Test the app on its default domain, add the custom domain to the environment and point the records at the domain provider to fortrabbit, see [external domain setup](https://docs.fortrabbit.com/platform/domains/external-domain-setup). Remove the `verify-*.ssl.on-forge.com` CNAME record that Forge's Let's Encrypt setup added.

## What stays on the Forge server

- Custom Nginx rules. fortrabbit runs Apache, so rewrites move into [.htaccess](https://docs.fortrabbit.com/dev/htaccess/redirects).
- Root-level software, system packages and daemons outside the app. fortrabbit has no root shell, see [limits](https://docs.fortrabbit.com/platform/concepts/limits).
- Mail sent with PHP `mail()`. Use SMTP or a transactional mail provider.

Once the site runs on fortrabbit, delete the site in Forge, and the server at the cloud provider.

---

- [Migrate to fortrabbit](/dev/how-to/migrate-to-fortrabbit)
- [Laravel guides](/guides/laravel)
- [Forge alternative](/alternatives/laravel-forge)
