<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>#LaravelDeployment &#8211; Aveshost Blog</title>
	<atom:link href="https://blog.aveshost.com/tag/laraveldeployment/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.aveshost.com</link>
	<description>Your Blueprint for Online Success</description>
	<lastBuildDate>Fri, 02 Jan 2026 23:50:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>

<image>
	<url>https://blog.aveshost.com/wp-content/uploads/2026/01/logo-150x150.png</url>
	<title>#LaravelDeployment &#8211; Aveshost Blog</title>
	<link>https://blog.aveshost.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Deploy Laravel Project on cPanel</title>
		<link>https://blog.aveshost.com/how-to-deploy-laravel-project-on-cpanel/</link>
					<comments>https://blog.aveshost.com/how-to-deploy-laravel-project-on-cpanel/#respond</comments>
		
		<dc:creator><![CDATA[Kennedy Dzigbenyo]]></dc:creator>
		<pubDate>Fri, 07 Feb 2025 18:40:42 +0000</pubDate>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[#HostLaravelOncPanel]]></category>
		<category><![CDATA[#Laravel]]></category>
		<category><![CDATA[#LaravelDeployment]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=2704</guid>

					<description><![CDATA[How to Host Laravel Project on cPanel To deploy Laravel project on cPanel can seem overwhelming, but it doesn’t have to be. Whether you’re launching a personal project or a client’s website, cPanel makes hosting Laravel applications straightforward. In this guide, I’ll walk you through the entire process, from setting up your hosting environment to [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading" id="how-to-host-laravel-project-on-c-panel">How to Host Laravel Project on cPanel</h2>



<p class="wp-block-paragraph">To deploy Laravel project on cPanel can seem overwhelming, but it doesn’t have to be. Whether you’re launching a personal project or a client’s website, cPanel makes hosting Laravel applications straightforward. </p>





<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#how-to-host-laravel-project-on-c-panel">How to Host Laravel Project on cPanel</a></div><div><a href="#prerequisites">Prerequisites</a></div><div><a href="#how-to-deploy-laravel-project-on-c-panel">How to Deploy Laravel Project on cPanel</a></div><div><a href="#deploy-laravel-project-on-c-panel-manual-deployment-without-terminal">Deploy Laravel Project on cPanel: Manual Deployment (without Terminal)</a></div><div><a href="#create-a-my-sql-database-and-import-a-database-file">Create a MySQL Database and Import a Database File</a></div><div><a href="#connecting-to-your-database">Connecting to Your Database</a></div><div><a href="#remove-public-from-the-url-of-a-laravel-installation">Remove &#8216;/public&#8217; from the URL of a Laravel installation</a></div><div><a href="#set-file-permissions">Set File Permissions</a></div><div><a href="#deploy-laravel-project-on-c-panel-via-terminal">Deploy Laravel Project on cPanel Via Terminal</a></div><div><a href="#optimize-laravel-for-production">Optimize Laravel for Production</a></div><div><a href="#set-up-cron-jobs-optional">Set Up Cron Jobs (Optional)</a></div><div><a href="#final-checks">Final Checks</a></div><div><a href="#conclusion">Conclusion</a></div><div><a href="#fa-qs-about-deploying-laravel-on-c-panel">FAQs About Deploying Laravel on cPanel</a></div></div></nav></div>



<p class="wp-block-paragraph">In this guide, I’ll walk you through the entire process, from setting up your hosting environment to ensuring your application runs smoothly.</p>



<h2 class="wp-block-heading" id="prerequisites">Prerequisites</h2>



<p class="wp-block-paragraph">Before diving into the deployment, make sure you have:</p>



<ul class="wp-block-list">
<li>A Laravel project ready for deployment</li>



<li>A cPanel hosting account. If you don&#8217;t already have<a href="https://www.aveshost.com/web-hosting" rel="noopener"> cPanel hosting</a>, you&#8217;ll need to purchase a<a href="https://www.aveshost.com/web-hosting" rel="noopener"> web hosting plan</a>. Aveshost offers several options, which you can explore <a href="https://www.aveshost.com/web-hosting" rel="noopener">here</a>. We&#8217;ve also created a step-by-step guide to walk you through the process: &#8220;<a href="https://blog.aveshost.com/how-to-buy-cpanel-hosting/">How to Buy cPanel Hosting</a>&#8220;.</li>



<li>A <a href="https://blog.aveshost.com/how-to-set-up-mysql-database-in-cpanel/">MySQL database created in cPanel</a></li>
</ul>



<h2 class="wp-block-heading" id="how-to-deploy-laravel-project-on-c-panel">How to Deploy Laravel Project on cPanel</h2>



<p class="wp-block-paragraph">This guide outlines two methods for deploying a Laravel project within a cPanel environment: deployment via Terminal access and manual deployment (without Terminal access). </p>



<p class="wp-block-paragraph">We will explore both options to accommodate users with varying cPanel configurations.</p>



<h2 class="wp-block-heading" id="deploy-laravel-project-on-c-panel-manual-deployment-without-terminal">Deploy Laravel Project on cPanel: Manual Deployment (without Terminal)</h2>



<p class="wp-block-paragraph">This section details the process of deploying a Laravel project on cPanel for users who do not have Terminal access. It covers the necessary steps for manually uploading files, configuring directories, and setting up the application without command-line interface capabilities.</p>



<h3 class="wp-block-heading" id="step-1-upload-your-laravel-project-to-c-panel"><strong>Step 1: Upload Your Laravel Project to cPanel</strong></h3>



<h4 class="wp-block-heading" id="option-1-upload-via-file-manager">Option 1: Upload via File Manager</h4>



<ol start="1" class="wp-block-list">
<li><strong>Zip Your Project</strong> – On your local machine, compress your Laravel project into a <code>.zip</code> file. It&#8217;s crucial that your zipped file contains all of these folders and files.</li>
</ol>



<figure class="wp-block-image size-full is-resized"><img fetchpriority="high" decoding="async" width="477" height="726" src="https://blog.aveshost.com/wp-content/uploads/2025/02/Laravel-project-files.png" alt="" class="wp-image-2767" style="width:380px;height:auto" srcset="https://blog.aveshost.com/wp-content/uploads/2025/02/Laravel-project-files.png 477w, https://blog.aveshost.com/wp-content/uploads/2025/02/Laravel-project-files-197x300.png 197w" sizes="(max-width: 477px) 100vw, 477px" /></figure>



<ol start="2" class="wp-block-list">
<li><strong>Open cPanel</strong> – Log into your cPanel account and navigate to <strong>File Manager</strong>.</li>



<li><strong>Upload the Zip File</strong> – Go to the <code>public_html</code> directory (this is the root directory where your website files should go. Alternatively, you can use a subdirectory if you have created a&nbsp;<a href="https://my.aveshost.com/knowledgebase/19/How-to-Create-a-Subdomain-in-cPanel.html" target="_blank" rel="noreferrer noopener">subdomain</a>), then upload the zipped project.</li>



<li>To view hidden files (such as .htaccess, .env), click on&nbsp;<strong>Settings</strong>&nbsp;in the top-right corner and enable&nbsp;<strong>Show Hidden Files (dotfiles)</strong>.</li>



<li><strong>Extract the Zip File</strong> – Once uploaded, right-click the file and select <strong>Extract</strong>.</li>



<li><strong>Move the Extracted Files</strong> – Move extracted files into the public_html folder or the subdirectory folder in case you are using a subdomain.</li>
</ol>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://blog.aveshost.com/wp-content/uploads/2025/02/deploy-your-laravel-project-extracted-files-1.png" alt="deploy your laravel project extracted files" class="wp-image-2824" style="width:766px;height:auto"/></figure>



<p class="wp-block-paragraph"><em>Note: After extracting the files, delete the zip file. Once the files are moved to the&nbsp;<code>public_html</code>&nbsp;directory, delete the laravel project folder.</em></p>



<p class="wp-block-paragraph"><strong>Suggested Reading:</strong> For detailed instructions on how to upload your project files to cPanel, follow this step-by-step guide: &#8220;<a href="https://blog.aveshost.com/how-to-upload-your-website/">How to Upload Your Project Files</a>.&#8221;</p>



<h3 class="wp-block-heading" id="option-2-upload-via-ftp"><strong>Option 2: Upload via FTP</strong></h3>



<ol start="1" class="wp-block-list">
<li>Use an FTP client like <strong>FileZilla</strong>.</li>



<li>Connect to your cPanel account using your FTP credentials.</li>



<li>Upload the project files to the appropriate directory (usually <code>public_html</code>).</li>
</ol>



<p class="wp-block-paragraph"><em>For detailed instructions on how to upload your project files to via FTP, follow this step-by-step guide: &#8220;<a href="https://blog.aveshost.com/how-to-upload-your-website/#step-2-upload-your-website-using-ftp-file-transfer-protocol">How to Upload Your Project Files Via FTP</a>&#8220;.</em></p>



<h2 class="wp-block-heading" id="create-a-my-sql-database-and-import-a-database-file">Create a MySQL Database and Import a Database File</h2>



<h3 class="wp-block-heading" id="creating-the-database">Creating the Database</h3>



<ol class="wp-block-list">
<li>In the cPanel dashboard, scroll down to the <strong>Databases</strong> section.</li>



<li>Click <strong>MySQL Database Wizard</strong>.</li>
</ol>



<h3 class="wp-block-heading" id="create-a-new-database">Create a New Database</h3>



<ol class="wp-block-list">
<li>Enter a name for your new database (e.g., <code>my_db</code>).</li>



<li>Click <strong>Next Step</strong>.</li>
</ol>



<h3 class="wp-block-heading" id="create-a-database-user">Create a Database User</h3>



<ol class="wp-block-list">
<li>Enter a <strong>username</strong> for the database user (e.g., <code>my_db_usr</code>).</li>



<li>Set a <strong>strong password</strong> (use the password generator for extra security).</li>



<li>Click <strong>Create User</strong>.</li>
</ol>



<h3 class="wp-block-heading" id="assign-privileges-to-the-user">Assign Privileges to the User</h3>



<ol class="wp-block-list">
<li>Check <strong>All Privileges</strong> to give full access to the user.</li>



<li>Click <strong>Next Step</strong> to finalize the setup.</li>
</ol>



<h3 class="wp-block-heading" id="import-the-database">Import the Database</h3>



<ol class="wp-block-list">
<li>Go back to cPanel and locate the <strong>phpMyAdmin</strong> tool in the <strong>Databases</strong> section.</li>



<li>Click <strong>phpMyAdmin</strong> to open it.</li>



<li>In phpMyAdmin, find the newly created database in the left sidebar and click on it.</li>



<li>Click the <strong>Import</strong> tab at the top.</li>



<li>Click <strong>Choose File</strong> and select the <code>.sql</code> database file from your PC.</li>



<li>Scroll down and click <strong>Go</strong> to start the import process.</li>
</ol>



<p class="wp-block-paragraph"><strong>Suggested Reading:</strong></p>



<ul class="wp-block-list">
<li><a href="https://blog.aveshost.com/how-to-set-up-mysql-database-in-cpanel/">How to Set Up a MySQL Database &amp; User in cPanel (2 Easy Methods)</a></li>



<li><a href="https://blog.aveshost.com/how-to-set-up-postgresql-database-in-cpanel/">How to Set Up a PostgreSQL Database and User in cPanel</a></li>
</ul>



<h2 class="wp-block-heading" id="connecting-to-your-database">Connecting to Your Database</h2>



<ol class="wp-block-list">
<li><strong>Locate the <code>.env</code> File</strong>
<ul class="wp-block-list">
<li>Navigate to your Laravel project directory.</li>



<li>If the <code>.env</code> file is not visible, click on <strong>Settings</strong> in the top-right corner and enable <strong>Show Hidden Files (dotfiles)</strong>.</li>



<li>If the <code>.env</code> file is still missing, re-upload it from your local PC.</li>



<li>Alternatively, if a <code>.env.example</code> file exists, copy it and rename it to <code>.env</code>.</li>
</ul>
</li>



<li><strong>Edit the <code>.env</code> File</strong>
<ul class="wp-block-list">
<li>Open the <code>.env</code> file in a text editor.</li>



<li>Update the necessary database configurations as required.</li>
</ul>
</li>
</ol>



<pre class="wp-block-code"><code>APP_URL=https://yourdomainname.com

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=yourCpanelUsername_yourDbName
DB_USERNAME=yourCpanelUsername_yourDbUsername
DB_PASSWORD=yourDatabasePassword</code></pre>



<p class="wp-block-paragraph">Save the changes, and your Laravel project should now be connected to the database.</p>



<h2 class="wp-block-heading" id="remove-public-from-the-url-of-a-laravel-installation">Remove &#8216;/public&#8217; from the URL of a Laravel installation</h2>



<p class="wp-block-paragraph">To remove <code>/public</code> from the URL, edit your <code>.htaccess</code> file or create a new one in the root folder and add:</p>



<pre class="wp-block-code"><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On
    RewriteRule ^(.*)$ public/$1 &#91;L]
&lt;/IfModule&gt;</code></pre>



<p class="wp-block-paragraph">Save your changes to the <code>.htaccess</code> file. Your site should now just be loading as domain.com instead of domain.com/public.</p>



<h2 class="wp-block-heading" id="set-file-permissions">Set File Permissions</h2>



<p class="wp-block-paragraph">For Laravel to work properly, you need to set the correct permissions for the <code>storage</code> and <code>bootstrap/cache</code> directories:</p>



<ol class="wp-block-list">
<li>Right-click on the <strong>storage</strong> folder and select <strong>Change Permissions</strong>.</li>



<li>Set the permissions to <strong>775</strong> (or <strong>777</strong> if necessary).</li>



<li>Repeat the same for the <strong>bootstrap/cache</strong> folder.</li>
</ol>



<p class="wp-block-paragraph">Alternatively, if you have <strong>SSH access</strong>, you can run the following command in the terminal:</p>



<pre class="wp-block-code"><code>chmod -R 775 storage bootstrap/cache</code></pre>



<p class="wp-block-paragraph">If you run into issues, try setting them to 777 temporarily:</p>



<pre class="wp-block-code"><code>chmod -R 777 storage bootstrap/cache</code></pre>



<p class="wp-block-paragraph">(However, setting 777 is not recommended for security reasons.)</p>



<h2 class="wp-block-heading" id="deploy-laravel-project-on-c-panel-via-terminal">Deploy Laravel Project on cPanel Via Terminal</h2>



<p class="wp-block-paragraph">Deploying a Laravel project on cPanel using the terminal (SSH) ensures better performance and flexibility compared to manual uploads. Follow these steps to deploy your Laravel application successfully.</p>



<h3 class="wp-block-heading" id="step-1-log-in-to-c-panel-and-access-terminal-ssh">Step 1: Log in to cPanel and Access Terminal (SSH)</h3>



<ol class="wp-block-list">
<li><strong>Log into your cPanel</strong> by visiting <code>domain.com/cpanel</code> and entering your credentials.</li>



<li><strong>Open the Terminal</strong> (if enabled) by navigating to <strong>Advanced</strong> &gt; <strong>Terminal</strong>.</li>
</ol>



<h3 class="wp-block-heading" id="step-2-navigate-to-the-correct-directory">Step 2: Navigate to the Correct Directory</h3>



<ol class="wp-block-list">
<li>By default, cPanel’s <strong>public_html</strong> is the web root directory.</li>



<li>Move to the <code>public_html</code> directory using:</li>
</ol>



<pre class="wp-block-code"><code>cd public_html</code></pre>



<h3 class="wp-block-heading" id="step-3-clone-your-laravel-project">Step 3: Clone Your Laravel Project</h3>



<p class="wp-block-paragraph">If your Laravel project is hosted on <strong>GitHub, GitLab, or Bitbucket</strong>, use the following command to clone it:</p>



<pre class="wp-block-code"><code>git clone https://github.com/yourusername/your-laravel-project.git</code></pre>



<p class="wp-block-paragraph"><strong>OR</strong> if you&#8217;re uploading manually, use <a href="https://blog.aveshost.com/how-to-upload-your-website/" data-type="post" data-id="2769"><strong>FTP/File Manager</strong> to upload</a> your Laravel files into <code>public_html</code>.</p>



<h3 class="wp-block-heading" id="step-4-move-laravel-files-to-the-root-directory">Step 4: Move Laravel Files to the Root Directory</h3>



<p class="wp-block-paragraph">If your project is inside a folder (e.g., <code>your-laravel-project</code>), move all files to <code>public_html</code>:</p>



<pre class="wp-block-code"><code>mv your-laravel-project/* your-laravel-project/.* .</code></pre>



<ol class="wp-block-list">
<li></li>
</ol>



<p class="wp-block-paragraph">Remove the empty directory:</p>



<pre class="wp-block-code"><code>rmdir your-laravel-project</code></pre>



<h3 class="wp-block-heading" id="step-5-install-dependencies-composer">Step 5: Install Dependencies (Composer)</h3>



<ol class="wp-block-list">
<li>Run the following command to install Laravel dependencies:</li>
</ol>



<pre class="wp-block-code"><code>composer install --no-dev --optimize-autoloader</code></pre>



<p class="wp-block-paragraph">If Composer is not available, install it using:</p>



<pre class="wp-block-code"><code>curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer</code></pre>



<h3 class="wp-block-heading" id="step-6-set-permissions"><strong>Step 6: Set Permissions</strong></h3>



<p class="wp-block-paragraph">Run the following commands to set correct file permissions:</p>



<pre class="wp-block-code"><code>chmod -R 755 storage bootstrap/cache
chmod -R 775 storage bootstrap/cache</code></pre>



<h3 class="wp-block-heading" id="step-7-configure-the-env-file">Step 7: Configure the <code>.env</code> File</h3>



<ul class="wp-block-list">
<li>If <code>.env</code> doesn&#8217;t exist, rename the <code>.env.example</code> file to <code>.env</code>:</li>
</ul>



<pre class="wp-block-code"><code>cp .env.example .env</code></pre>



<ul class="wp-block-list">
<li>Open the <code>.env</code> file and update the database credentials:</li>
</ul>



<pre class="wp-block-code"><code>nano .env</code></pre>



<p class="wp-block-paragraph">Modify these values to match your cPanel MySQL details:</p>



<pre class="wp-block-code"><code>APP_URL=https://yourdomainname.com

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=yourCpanelUsername_yourDbName
DB_USERNAME=yourCpanelUsername_yourDbUsername
DB_PASSWORD=yourDatabasePassword</code></pre>



<h3 class="wp-block-heading" id="step-8-generate-application-key">Step 8: Generate Application Key</h3>



<p class="wp-block-paragraph">Run the command:</p>



<pre class="wp-block-code"><code>php artisan key:generate</code></pre>



<h3 class="wp-block-heading" id="step-9-run-database-migrations">Step 9: Run Database Migrations</h3>



<p class="wp-block-paragraph">If your Laravel project has database migrations, execute:</p>



<pre class="wp-block-code"><code>php artisan migrate --force</code></pre>



<h3 class="wp-block-heading" id="step-10-remove-public-from-the-url-of-a-laravel-installation">Step 10: Remove &#8216;/public&#8217; from the URL of a Laravel installation</h3>



<p class="wp-block-paragraph">To remove <code>/public</code> from the URL, edit your <code>.htaccess</code> file or create a new one in the root folder and add:</p>



<pre class="wp-block-code"><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On
    RewriteRule ^(.*)$ public/$1 &#91;L]
&lt;/IfModule&gt;</code></pre>



<p class="wp-block-paragraph">Save your changes to the <code>.htaccess</code> file. Your site should now just be loading as domain.com instead of domain.com/public.</p>



<h3 class="wp-block-heading" id="step-11-set-up-file-permissions">Step 11: Set Up File Permissions</h3>



<p class="wp-block-paragraph">Run the following commands:</p>



<pre class="wp-block-code"><code>chmod -R 755 public
chmod -R 775 storage bootstrap/cache</code></pre>



<h2 class="wp-block-heading" id="optimize-laravel-for-production">Optimize Laravel for Production</h2>



<p class="wp-block-paragraph">Run the following optimization commands:</p>



<pre class="wp-block-code"><code>php artisan config:clear
php artisan route:clear
php artisan view:clear</code></pre>



<p class="wp-block-paragraph">This will speed up your application by caching configurations and routes.</p>



<h2 class="wp-block-heading" id="set-up-cron-jobs-optional">Set Up Cron Jobs (Optional)</h2>



<p class="wp-block-paragraph">Laravel uses scheduled tasks that should run automatically. In cPanel:</p>



<ol start="1" class="wp-block-list">
<li>Go to <strong>Cron Jobs</strong> under the Advanced section.</li>



<li>Add a new cron job with the command:</li>
</ol>



<pre class="wp-block-code"><code><code>php /home/your-cpanel-username/public_html/artisan schedule:run &gt;&gt; /dev/null 2&gt;&amp;1</code></code></pre>



<p class="wp-block-paragraph">Set it to run every minute (<code>*/5 * * * *</code>).</p>



<h2 class="wp-block-heading" id="final-checks">Final Checks</h2>



<p class="wp-block-paragraph">Now that everything is set up, visit your website and check if it loads correctly. If you encounter errors:</p>



<ul class="wp-block-list">
<li>Check file permissions.</li>



<li>Review the <code>.env</code> file for database connection issues.</li>



<li>Run <code>php artisan cache:clear</code> and <code>php artisan config:clear</code>.</li>
</ul>



<p class="wp-block-paragraph">If all goes well, congratulations! Your Laravel project is now successfully deployed on cPanel.</p>



<h2 class="wp-block-heading" id="conclusion">Conclusion</h2>



<p class="wp-block-paragraph">Deploying a Laravel project on cPanel might seem complex at first, but by following these step-by-step instructions, you can get your application up and running smoothly. Whether you&#8217;re manually uploading files or using Git, optimizing for production is key to ensuring speed and security.</p>



<p class="wp-block-paragraph">If you found this guide helpful, feel free to share it or drop a comment below if you have any questions!</p>



<p class="wp-block-paragraph">Happy coding!</p>



<p class="wp-block-paragraph"><strong>Suggested Reading:</strong></p>



<ul class="wp-block-list">
<li><a href="https://blog.aveshost.com/how-to-remove-html-php-from-urls/">How to Remove .html, .php, or Both from URLs</a></li>



<li><a href="https://blog.aveshost.com/how-to-upload-your-website/">How to Upload Your Website (in 3 Simple Steps)</a></li>



<li><a href="https://blog.aveshost.com/how-to-transfer-your-domain/">How To Transfer Your Domain: A Step-by-Step Guide</a></li>



<li><a href="https://blog.aveshost.com/how-to-buy-cpanel-hosting/">How to Buy cPanel Hosting for Your Website: Beginner’s Guide</a></li>



<li><a href="https://blog.aveshost.com/how-to-flush-dns/">How to Flush DNS Cache on Windows, Mac, Linux &amp; Browsers</a></li>



<li><a href="https://blog.aveshost.com/how-to-start-an-online-store-in-ghana/">How to Start an Online Store in Ghana: Comprehensive Guide</a></li>
</ul>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="fa-qs-about-deploying-laravel-on-c-panel">FAQs About Deploying Laravel on cPanel</h2>


<div id="rank-math-faq" class="rank-math-block">
<div class="rank-math-list ">
<div id="rm-faq-86cf1eb51d70691ccba2235bb52e9827" class="rank-math-list-item">
<h3 class="rank-math-question ">What are the prerequisites for deploying a Laravel project on cPanel?</h3>
<div class="rank-math-answer ">

<p>You need a Laravel project ready for deployment, a cPanel hosting account, and a MySQL database created in cPanel.</p>

</div>
</div>
<div id="rm-faq-6657949bee6683f6fea04f21734e0d40" class="rank-math-list-item">
<h3 class="rank-math-question ">What are the two methods for deploying a Laravel project on cPanel?</h3>
<div class="rank-math-answer ">

<p>The two methods are manual deployment without Terminal access and deployment via Terminal (SSH) access.</p>

</div>
</div>
<div id="rm-faq-52db2c0fbca15a223b7ca74cc0fa9d5c" class="rank-math-list-item">
<h3 class="rank-math-question ">How do I upload my Laravel project to cPanel manually?</h3>
<div class="rank-math-answer ">

<p>Zip your Laravel project, upload it via cPanel&#8217;s File Manager to the public_html directory, extract it, move the files, and delete the zip and original folder.</p>

</div>
</div>
<div id="rm-faq-d92a6b3b0188d8bc06c26d492bb4457d" class="rank-math-list-item">
<h3 class="rank-math-question ">How do I create and import a MySQL database for Laravel in cPanel?</h3>
<div class="rank-math-answer ">

<p>Use the MySQL Database Wizard in cPanel to create a database and user, assign privileges, then import a .sql file via phpMyAdmin.</p>

</div>
</div>
<div id="rm-faq-2e896f1adb89b7371fc4a46ade283154" class="rank-math-list-item">
<h3 class="rank-math-question ">How do I connect my Laravel project to the database in cPanel?</h3>
<div class="rank-math-answer ">

<p>Edit the .env file in your Laravel project directory to update database configurations like DB_DATABASE, DB_USERNAME, and DB_PASSWORD with your cPanel details.</p>

</div>
</div>
<div id="rm-faq-e6cec873021651ec8553249ce0954c7c" class="rank-math-list-item">
<h3 class="rank-math-question ">How can I remove &#8216;/public&#8217; from the Laravel URL in cPanel?</h3>
<div class="rank-math-answer ">

<p>Edit or create an .htaccess file in the root folder with rewrite rules to redirect requests to the public directory, so the site loads as domain.com instead of domain.com/public.</p>

</div>
</div>
<div id="rm-faq-4a5f48c265d6a1cefac59df0e9bb74ac" class="rank-math-list-item">
<h3 class="rank-math-question ">What file permissions are needed for Laravel to work on cPanel?</h3>
<div class="rank-math-answer ">

<p>Set permissions to 775 (or 777 if necessary) for the storage and bootstrap/cache directories to ensure Laravel functions properly.</p>

</div>
</div>
</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blog.aveshost.com/how-to-deploy-laravel-project-on-cpanel/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
