
Taylor Otwell recently announced Laravel Cloud, which is pretty awesome. Laravel Cloud is a fully managed Laravel-first platform designed for simplicity and speed, minimising DevOps overhead. The Laravel ecosystem also includes Forge and Vapor which are pretty handy for deployment, but are not for everyone. For many developers, all three Laravel-first products have two things going against them: they are not cheap and they are only tailored to host Laravel projects. What if you can get a more affordable VPS on which you can host Laravel and other things from your preferred hosting company?
When you have your own VPS, you could DIY everything using countless guides available on the web. That would be great, but some people prefer graphic user interfaces. Enter CloudPanel...
Why Consider CloudPanel for Deploying Laravel?
- Cost Effective: If you already have a VPS, CloudPanel is free and lightweight.
- User Friendly: It offers a clean interface for managing sites, databases and SSL.
- Laravel Support: Comes with pre-configured Laravel site templates and PHP versions.
- Control: You maintain full control over your VPS environment.
- Versatile Hosting: CloudPanel supports hosting not only Laravel but also other types of sites, including Node.js, Python and WordPress.
System Requirements for CloudPanel
To install CloudPanel on your VPS, ensure your server meets these minimum specs:
Requirement | Minimum Specification |
---|---|
Operating System | Debian 11 or 12, Ubuntu 22.04 or 24.04 LTS (x86 or ARM64) |
CPU Cores | At least 1 core |
RAM | Minimum 2 GB |
Disk Space | At least 10 GB |
These requirements cover a basic setup to host multiple PHP applications including Laravel.
Step-by-Step Guide to Deploy Laravel on a Fresh VPS Using CloudPanel
1. Install CloudPanel on Your VPS
- Start with a fresh VPS running Debian 11/12 or Ubuntu 22.04/24.04. It is important to make sure that it is a fresh install of the OS.
- Connect via SSH to your server.
- Update your system packages:
sudo apt update && sudo apt -y upgrade
- Download and install CloudPanel using their official installer script (refer to CloudPanel docs for the latest commands). At the time of writing, you can install CloudPanel with MySQL 8 on Debian 12 using the following command:
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \
sha256sum -c && sudo bash install.sh
- Sit back and watch the script do its magic.
- After installation, access CloudPanel’s web interface via your server IP at port 8443 (e.g., https://your-server-ip:8443).
- Log in and complete the initial setup.
2. Create a Laravel Site in CloudPanel
- In the CloudPanel dashboard, click + Add Site.
- Choose Create a PHP Site.
- Select the Laravel version template (e.g., Laravel 12 or Laravel 10).
- Enter your domain name, site user and password.
- Click Create to provision the site with the correct PHP version and Laravel vhost template.
- On the newly created site's row, click Manage. Go to the Databases tab and create a database and a user. Avoid giving your user a name that already exists on the system. That means avoiding
root
.
3. Deploy Laravel Application
-
Now you have a few options for deploying your app. You can make use of CloudPanel's file manager. Just make sure that the root of your Laravel app is the directory whose name is your domain. Alternatively, you can make use of SSH and git using the steps below.
-
SSH into your server as the site user you created:
ssh site-user@your-server-ip
- Navigate to the
htdocs
directory and remove the default created folder:
cd htdocs && rm -rf your-domain.com
- Clone the repo making sure to correctly type directory name to replace the
your-domain.com
directory you removed above:
git clone https://github.com/your-username/your-repo.git your-domain.com
- Install packages and build assets:
cd your-domain.com
composer install && npm install && npm run build
- Adjust your
.env
file with database and app URL settings as needed. - Set appropriate permissions if necessary.
- Your Laravel app is now ready! If your domain is pointed to the correct IP address, you can now visit your domain in a browser to see the Laravel welcome page.
4. Additional Configuration
- Use CloudPanel to create and manage databases.
- Install SSL certificates via CloudPanel’s SSL/TLS section (e.g., Let’s Encrypt).
- Configure any additional services like caching or queues manually or via SSH.
- Setup CI/CD. That is a topic for another post.
Conclusion
While Laravel Forge, Vapor and Cloud offer powerful and streamlined deployment experiences, CloudPanel is an excellent alternative for developers who prefer to manage their own VPS environment affordably. Starting from a fresh VPS, CloudPanel simplifies Laravel deployment with pre-built templates, easy site creation and management tools, making it a practical choice for many developers looking for control without complexity.
If you have a VPS and want an easy, cost-effective way to deploy Laravel, CloudPanel is worth considering.