How to Deploy a Laravel Project on SiteGround WordPress Hosting GrowBig Plan

How to Deploy a Laravel Project on SiteGround WordPress Hosting GrowBig Plan
Introduction
While SiteGround’s WordPress Hosting GrowBig plan is specifically optimized for WordPress sites, many developers wonder if they can use it to host Laravel applications instead. The good news is that it’s entirely possible! In this guide, we’ll walk you through the process of deploying a Laravel project on SiteGround’s WordPress Hosting GrowBig plan.
Understanding SiteGround’s WordPress Hosting GrowBig
Before diving into the deployment process, let’s understand what the GrowBig plan offers. The WordPress Hosting GrowBig plan includes:
- 20GB storage space
- Unlimited bandwidth
- Support for multiple websites
- Enhanced security and backup features
- SuperCacher technology for improved performance
- WordPress staging environment
- 24/7 customer support
While these features are tailored for WordPress, the underlying infrastructure is fully capable of supporting Laravel applications.
Expert Insights
Join 1,000+ business owners getting actionable web & marketing insights every month.
No spam, unsubscribe anytime.Privacy Policy
Prerequisites
Before you begin deploying Laravel on SiteGround’s WordPress Hosting GrowBig, ensure you have:
- An active SiteGround WordPress Hosting GrowBig account
- SSH access enabled on your account
- Basic knowledge of command-line operations
- Composer installed on the server (it comes pre-installed on SiteGround servers)
- PHP 7.3 or higher (SiteGround supports multiple PHP versions up to 8.3)
Step-by-Step Deployment Guide
Step 1: Enable SSH Access
The first step is to enable SSH access to your account:
- Log in to your SiteGround Site Tools
- Navigate to Devs section and select SSH Keys Manager
- Import your public SSH key for secure authentication
- Optionally, restrict SSH access to specific IP addresses for enhanced security
Step 2: Connect via SSH
Once SSH is enabled, connect to your server:
Replace username with your SiteGround username and your-domain.com with your actual domain.
Step 3: Create Your Laravel Project
Navigate to your project directory and create a new Laravel project using Composer:
This command will create a new Laravel project in a folder named blog. If you prefer to install Laravel directly in the root directory (without a subfolder), you can use:
The dot (.) indicates the current directory.
Step 4: Configure Your Web Root
Laravel’s main entry point is the index.php file located in the public/ folder. You need to configure your domain or subdomain to point to this directory.
Option A: Using a Subdirectory
If you want to access your Laravel app at your-domain.com/blog, no additional configuration is needed. The Laravel application will be accessible at that URL.
Option B: Using the Main Domain
If you want your Laravel app to be the primary site (accessed directly from your domain), create a symbolic link:
Alternatively, you can rename directories or adjust your domain settings in the SiteGround control panel to point to the Laravel public folder.
Step 5: Configure Your Environment File
Navigate to your Laravel project directory and set up the .env file:
Edit the .env file with your database credentials:
Step 6: Create and Configure Your Database
In the SiteGround control panel:
- Go to Databases section
- Click MySQL Databases or MariaDB Databases
- Create a new database with your desired name
- Create a new database user with a strong password
- Assign the user to the database with all privileges
Update your .env file with these credentials.
Step 7: Run Database Migrations
Before your application can run properly, you need to create the necessary database tables:
If you have seeders to populate initial data:
Step 8: Set File Permissions
Ensure proper permissions for Laravel’s storage and bootstrap directories:
Step 9: Optimize Your Application (Optional but Recommended)
For improved performance in production, run these optimization commands:
Important Considerations
Is WordPress Hosting GrowBig the Best Choice for Laravel?
While technically possible, there are some points to consider:
- Plan Design: The WordPress Hosting plan is specifically optimized for WordPress. If Laravel is your primary use case, SiteGround’s general Hosting plans might offer better-suited features and support.
- Support and Tools: SiteGround’s support team is highly trained in WordPress support. While they can assist with general hosting issues, they may have limited expertise with Laravel-specific problems.
- One-Click Installation: The WordPress Hosting plan includes WordPress one-click installation, which won’t be useful for a Laravel project.
- Performance Optimization: Features like WordPress staging and WordPress-specific caching may not benefit your Laravel application.
When Should You Consider the Regular Hosting Plan Instead?
If any of the following apply, consider SiteGround’s regular Hosting plans instead:
- Laravel is your primary or only application
- You need Laravel-specific support and guidance
- You plan to deploy multiple Laravel applications
- You want to maximize performance for non-WordPress applications
Troubleshooting Common Issues
Composer Installation Fails
If Composer runs out of memory:
Permission Denied Errors
Ensure proper permissions for Laravel directories:
404 Errors After Deployment
Make sure your .htaccess file exists in the Laravel public directory. If not, create one with:
Database Connection Issues
Verify your database credentials in the .env file. Test the connection by running:
Then in the Tinker shell:
If successful, it will return a PDO object without errors.
Conclusion
Deploying Laravel on SiteGround’s WordPress Hosting GrowBig plan is feasible and can work well for small to medium-sized applications. However, it’s important to evaluate whether this plan aligns with your specific needs. If Laravel is your primary project, you might benefit more from SiteGround’s general Hosting plans that are designed to support various PHP-based applications without WordPress-specific limitations.
For the best experience, don’t hesitate to contact SiteGround’s 24/7 support team to discuss your specific Laravel deployment requirements and get their recommendations.
Additional Resources
Some assets in this article are Designed by Freepik.