{"id":2194,"date":"2017-10-31T19:17:24","date_gmt":"2017-10-31T13:47:24","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=2194"},"modified":"2026-09-10T19:27:13","modified_gmt":"2026-09-10T13:57:13","slug":"laravel-installation-vestacp-account","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/laravel-installation-vestacp-account\/","title":{"rendered":"Laravel installation on VestaCP account"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Originally published October 31, 2017. Updated September 10, 2026 to reflect current Laravel and Ubuntu versions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This guide covers how to install Laravel on a VestaCP account, using Nginx and PHP-FPM.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One note before starting: this guide&#8217;s original version targeted <strong>Laravel 5.5<\/strong> and <strong>Ubuntu 16.04<\/strong>, both of which are long past end-of-support. Laravel 5.5 reached end-of-life years ago, and Ubuntu 16.04 no longer receives security updates. The steps below still work conceptually on a current setup, but check <a href=\"https:\/\/laravel.com\/docs\" target=\"_blank\" rel=\"noopener\">Laravel&#8217;s current PHP version requirements<\/a> for whichever Laravel version you&#8217;re actually installing, since requirements change between major versions.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">I. Prerequisites<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A VestaCP server with Nginx<\/li>\n\n\n\n<li>PHP 8.1+ (or whatever your target Laravel version requires \u2014 check current docs)<\/li>\n\n\n\n<li>Root\/SSH access to the server<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">II. How Laravel Runs Under Nginx<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Laravel&#8217;s actual application code lives in a <code>public<\/code> subfolder, not the project root. Nginx needs to point directly at that <code>public<\/code> folder, and all requests that aren&#8217;t real files get routed through <code>index.php<\/code> \u2014 Laravel&#8217;s front controller, which handles routing internally.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/laravel_request_lifecycle_detail-scaled.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"831\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/laravel_request_lifecycle_detail-1024x831.png\" alt=\"\" class=\"wp-image-11640\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/laravel_request_lifecycle_detail-1024x831.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/laravel_request_lifecycle_detail-300x244.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/laravel_request_lifecycle_detail-768x623.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/laravel_request_lifecycle_detail-1536x1247.png 1536w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/laravel_request_lifecycle_detail-2048x1662.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This is why simply pointing your domain at the project&#8217;s root folder doesn&#8217;t work \u2014 the site won&#8217;t load correctly until Nginx&#8217;s document root is updated to the <code>public<\/code> subfolder, covered in Step VI.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">III. Install Required PHP Extensions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Laravel needs several PHP extensions that aren&#8217;t always installed by default. The original guide skipped this step entirely \u2014 install them first:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apt-get install php-xml php-mbstring php-tokenizer php-curl php-pdo php-bcmath -y\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Adjust package names to include your specific PHP version if your system uses versioned packages (e.g., <code>php8.1-xml<\/code> instead of <code>php-xml<\/code>).<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">IV. Install Composer<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The original guide used <code>apt-get install composer<\/code>, but Ubuntu&#8217;s repository version is often outdated. Install it using the official method instead:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl -sS https:\/\/getcomposer.org\/installer | php\nmv composer.phar \/usr\/local\/bin\/composer\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">V. Install the Laravel Installer<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">composer global require \"laravel\/installer\"\nexport PATH=$PATH:$HOME\/.config\/composer\/vendor\/bin\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">If you&#8217;re running these commands as a specific user (like <code>admin<\/code> on VestaCP, not root), make sure <code>$HOME<\/code> resolves to that user&#8217;s actual home directory, not root&#8217;s \u2014 otherwise the installer won&#8217;t be found on <code>$PATH<\/code> afterward.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">VI. Create the Laravel Project<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Navigate to your domain&#8217;s document root:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd \/home\/admin\/web\/domain.com\/public_html\/\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new Laravel project:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">laravel new blog\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Alternatively, <code>composer create-project laravel\/laravel blog<\/code> works the same way and is the more commonly recommended method for current Laravel versions.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">VII. Set Ownership and Permissions<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">chown -R admin: blog\ncd blog\nchmod 775 storage\nchmod 775 bootstrap\/cache\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> The original instructions had a typo \u2014 <code>storge<\/code> instead of <code>storage<\/code> \u2014 which would fail with &#8220;No such file or directory&#8221; since that folder doesn&#8217;t exist under that name.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">VIII. Point Nginx at the public Folder<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the domain&#8217;s Nginx config:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">vi \/home\/admin\/conf\/web\/nginx.conf\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Find:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">root \/home\/admin\/web\/domain.com\/public_html;\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change to:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">root \/home\/admin\/web\/domain.com\/public_html\/blog\/public;\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add Laravel&#8217;s front-controller routing rule inside the relevant <code>location \/<\/code> block:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">location \/ {\n    try_files $uri $uri\/ \/index.php?$query_string;\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">IX. Verify and Restart Nginx<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">nginx -t\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the syntax check passes:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/etc\/init.d\/nginx restart\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Visit <code>http:\/\/domain.com\/<\/code> to confirm the Laravel welcome page loads.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">X. Optional: Add Redis as a Cache Backend<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apt-get install php-redis\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enable the extension in <code>php.ini<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">extension=redis.so\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> The original guide&#8217;s line had a trailing semicolon (<code>extension=redis.so;<\/code>), which isn&#8217;t valid <code>php.ini<\/code> syntax \u2014 a semicolon at the start of a line marks a comment, but appending one after a real directive can cause it to be misread. Leave it off.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Restart both services \u2014 using your server&#8217;s actual installed PHP-FPM version, not a hardcoded one:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/etc\/init.d\/nginx restart\n\/etc\/init.d\/php8.1-fpm restart\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Check your actual PHP-FPM service name first with <code>systemctl list-units | grep php-fpm<\/code> if unsure.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">XI. Conclusion<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Installing Laravel on VestaCP comes down to setting up Composer correctly, installing the PHP extensions Laravel actually needs, creating the project, fixing folder permissions (watch for the <code>storage<\/code> typo), and pointing Nginx at the <code>public<\/code> subfolder rather than the project root. With that done, Laravel&#8217;s front controller handles the rest of the routing.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Why does my site show a blank page or 403 error after installation?<\/strong> This is almost always the Nginx document root still pointing at the project root instead of <code>blog\/public<\/code> \u2014 double-check Step VIII.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Do I need Redis, or is it optional?<\/strong> Optional \u2014 Laravel works with file-based caching by default. Redis is worth adding for better performance under real traffic, but isn&#8217;t required to get started.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What if <code>laravel<\/code> command isn&#8217;t found after installation?<\/strong> Confirm the <code>export PATH<\/code> line in Step V actually applied to your current shell session, and that it points to the correct user&#8217;s home directory.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-add-proxy-pass-rule-to-access-phpmyadmin-without-port-number-in-url-plesk\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to add Proxy pass rule to access PHPMyAdmin without port number in URL -Plesk<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/install-phpmyadmin-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install phpMyAdmin on Ubuntu<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to our experts.<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Looking for the right technology solution for your business? Our team of experts can help you with development, cloud, DevOps, design, and a wide range of other technology needs. Get in touch with our team <a href=\"https:\/\/pheonixsolutions.com\/contact\">here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Originally published October 31, 2017. Updated September 10, 2026 to reflect current Laravel and Ubuntu versions. Introduction This guide covers [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1019],"tags":[],"class_list":["post-2194","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-zo","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=2194"}],"version-history":[{"count":4,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2194\/revisions"}],"predecessor-version":[{"id":11646,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2194\/revisions\/11646"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}