Provision an Ubuntu VM and Deploy a Laravel App with Laravel Forge
8 Aug 2025 · 5 min read · Cloud, Devops & Infrastructure, Tutorials
Introduction
Deploying a Laravel app does not have to involve manual package installs or custom scripts. Katapult gives you a clean Ubuntu 24.04 VM in seconds, while Laravel Forge integrates with the VM, provisions the LAMP/LEMP stack and deployment hooks for you.
In this guide you will:
- launch an Ubuntu 24.04 VM on Katapult
- connect that VM to Laravel Forge (any paid plan),
- push a fresh Laravel starter kit to GitHub and deploy it
By the end you will have a repeatable workflow—code push, Forge builds, Katapult serves, and a solid base for adding a domain and SSL when you are ready.
Prerequisite
- Katapult account — sign-up comes with £100 free credit
- Laravel Forge account — any paid plan
- Github, BitBucket or GitLab Account
- Git installed locally
Provision a Virtual Machine with Katapult Compute
- Navigate to the Katapult dashboard, in the sidebar choose Compute ▸ Virtual machines, then click Launch virtual machine.

Select the data centre closest to your users or team.
For this walkthrough the ROCK-3 plan (1 vCPU, 3 GB RAM, 25 GB NVMe) is enough. You can scale up later without rebuilding.
New Katapult users start with £100 free credit, so spinning up the 1 vCPU / 3 GB RAM VM needed for this guide (just £15 per month) costs you nothing while you test the stack.
Under Distributions pick Ubuntu 24.04. Although, this guide can be replicated in any Linux distro.
Keep the public IPv4 & IPV6 addresses that Katapult assigns.
Click Launch virtual machine. Provisioning takes less than a minute.
Once the VM is ready, copy the root password shown in the VM details page and log in as root.
ssh root@<VM_IP>
- After logging in as root, create a new user with sudo privileges. Replace
with your desired username:
# Create a new user
adduser <username>
# Add the user to the sudo group
usermod -aG sudo <username>
# Verify by switching to the new user and running a sudo command
su - <username>
whoami
- Copy the IPv4 address shown in the VM details page—you'll enter it in the Laravel Forge dashboard.
That's it! your fresh Ubuntu 24.04 VM is ready to be connected to Laravel Forge.
Add the Katapult VM to Laravel Forge
To connect the Katapult VM, log in in to the Lavarvel Forge and navigate to Dashboard → Servers → Create Server → Custom VPS.

Next, fill out the form with the following details:
Give the machine a name (for example, katapult-demo),
Keep App Server as the type,
Paste the public IPv4 address of your Katapult VM, and leave the SSH port at 22.
The NAT box stays unchecked because the VM already has a public IP.
Click Create Server. Forge then displays a dialog that shows three critical items:

- a long one-line command that starts with:
wget -O forge.sh "https://forge.laravel.com/servers/…
- a random sudo password
- a random MySQL database password.
Make sure to copy all three values and store them; Forge will not show them again. Also, you can use PostgreSQL instead by selecting it in the Advanced Settings during server configuration in the Forge dashboard.
Next, connect to the VM:
ssh root@<VM_IP>
Paste the the command exactly as Forge gave it and press Enter. The script downloads a helper file, runs it, and installs Nginx, PHP-FPM, Composer, the Forge agent, and any extras you selected in the advanced settings menus such as PostgreSQL. The process takes about ten minutes. You can watch progress in the Forge dashboard—the sidebar lights up as each component finishes.

When Forge finishes installing the required packages, the VM is fully configured: the forge user is in place with the sudo password you saved, and MySQL is running. Forge then redirects you to the server page in the dashboard.

The machine is now ready for your Laravel site.
Use the Default MySQL Instance and Prepare the Laravel Site
Forge already installed MySQL 8 during provisioning and created a forge super-user for you, so there's no extra database setup on the server itself. All you need is a schema for your application and the matching connection details in Laravel's .env.
Start by opening the Database tab in Forge's left-hand menu. Under Add Database give your schema a name—myapp works fine—and click Create. The new database appears in the list immediately and is owned by the forge user whose password appeared in the one-time credentials popup (keep that password safe; Forge will not show it again).

After the database installs, switch to your local terminal and scaffold a fresh Laravel starter kit.
Before you scaffold the starter kit, make sure the VM has Composer and the global Laravel installer:
# 1. Download Composer (if you don't have it)
sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
sudo php -r "unlink('composer-setup.php');"
# 2. Verify Composer
composer --version
# 3. Install the Laravel installer globally
composer global require laravel/installer
# 4. Make the global bin directory available
echo 'export PATH="$HOME/.config/composer/vendor/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# 5. Check the installer
laravel --version
Next, create a git repo for your new application and run the following commands:
laravel new myapp
The installer asks which starter kit you want (React, Vue, or Livewire) and which auth stack to use, pick the options you prefer. During generation the installer creates a tiny SQLite file (database/database.sqlite) and runs the default migrations so you can test locally without configuring MySQL. That file is already in the project's .gitignore, so it never reaches GitHub or Forge.
Prefer PostgreSQL?
You can stop the MySQL service (sudo systemctl disable --now mysql) and install PostgreSQL instead. Forge's database guide >covers the steps: https://forge.laravel.com/docs/resources/databases.
After the application has been generated by the installer, push to Github:
cd myapp
git init
git add .
git commit -m "Fresh Laravel starter kit"
git remote add origin git@github.com:<your-user>/myapp.git
git push -u origin main
Connect Source Control Provider to Laravel Forge and Deploy Application
After pushing the site to Github, you need to connect your Github account to Laravel Forge so that you application repository can be automatically pulled into Forge for deployment. \n\nTo do this, navigate to My Account → Source Control then select your source control provider and authenticate. You can learn more about this in the Laravel Forge official documentation.
When authentication is done, you can deploy your new site by navigating Sites in the Forge dashboard, enter a domain name for your site and select Add Site.

On creating your site, you'll be required to install the application via Git repository, Statamic, Wordpress or phpMyAdmin — Select Git Repository.

Next, enter your username/repo, select the branch and the myapp database we created earlier and Install Repository.

Once the repository is connected, click Deploy Now in the top-right corner to run the first deployment.
Enable Quick Deploy with Laravel Forge
Turn on Quick Deploy so Forge redeploys whenever you push to the main branch.
Go to Site → Deployments and click Enable Quick Deploy.

Add a real domain and HTTPS
- Point your domain's A record at the VM's public IPv4 address.
- In Forge open Sites → myapp → SSL, choose Let's Encrypt, and enter the domain (comma-separate multiple names if needed).
- Obtain the certificate. Forge will auto-renew it within 21 days or less before it expires and will email you if a renewal fails. You need an active Forge subscription for renewals to run.
If you want a "redirect HTTP → HTTPS" rule, add it under Sites → Redirects after the certificate is active.*
- When it finishes, visit your domain to see the app live.
Conclusion
Spinning up an Ubuntu 24.04 VM on Katapult and wiring it to Laravel Forge turns a bare server into a fully managed Laravel host in minutes. Katapult handles the reliable infrastructure, while Forge installs the web stack, manages MySQL, and redeploys your code on every push. With a domain and Let's Encrypt SSL in place, you have a secure, production-ready environment—and the process is simple enough to repeat whenever you need another application online.
To explore more of what you can do with Katapult infrastructure, see the official docs: https://docs.katapult.io/
For more on creating sites, installing applications, and managing your server, see Forge's basics guide: https://forge.laravel.com/docs/sites/the-basics.
Share this article
About the author
Shedrack A
Technical Copywriter