{"id":529,"date":"2024-03-14T12:18:30","date_gmt":"2024-03-14T12:18:30","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2024\/03\/14\/9070980-how-to-use-the-laravel-vps-template-at-hostinger\/"},"modified":"2026-03-16T12:12:00","modified_gmt":"2026-03-16T12:12:00","slug":"9070980-how-to-use-the-laravel-vps-template-at-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/9070980-how-to-use-the-laravel-vps-template-at-hostinger\/","title":{"rendered":"How to Use the Laravel VPS Template at Hostinger"},"content":{"rendered":"<p class=\"no-margin\"><b><a href=\"https:\/\/laravel.com\/\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Laravel<\/a><\/b> is a robust PHP framework designed for developers who need a simple and elegant toolkit to create full-featured web applications. Hostinger&rsquo;s <b><a href=\"\/support\/1583571-what-are-the-available-operating-systems-for-vps\" target=\"_blank\" class=\"intercom-content-link\">Ubuntu 24.04 64bit with Laravel<\/a> <\/b>VPS template simplifies the Laravel setup by coming pre-installed with Laravel on the CloudPanel control panel and Composer, PHP&rsquo;s dependency manager. <\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">This guide will walk you through the basics of getting your Laravel project up and running on this template.<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-interblocks-callout\" style=\"background-color: #e3e7fa80;border-color: #334bfa33\">\n<p class=\"no-margin\">If you don&rsquo;t have a VPS yet, consider purchasing one of our <b><a href=\"https:\/\/www.hostinger.com\/vps\/laravel-hosting\" target=\"_blank\" class=\"intercom-content-link\">Laravel VPS hosting plans<\/a><\/b> to proceed &#128640;<\/p>\n<\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_399c86b280\">Accessing CloudPanel<\/h2><p class=\"no-margin\">Open a web browser and navigate to <b><code>https:\/\/your-vps-ip:8443<\/code><\/b>. Make sure to replace <b><code>your-vps-ip<\/code><\/b> with the actual <b><a href=\"\/support\/5139756-how-to-find-your-vps-ip-address\" target=\"_blank\" class=\"intercom-content-link\">IP address of your VPS<\/a><\/b>. Use the credentials you provided during template installation to log in to the CloudPanel interface:<\/p><p class=\"intercom-align-center no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2024\/03\/814a33f1-846c-4778-8ee1-55cd4bea0dd8.jpg\" alt=\"Accessing CloudPanel\" width=\"400\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_0af6ed1e11\">Exploring Laravel&rsquo;s Structure<\/h2><p class=\"no-margin\">Laravel has a <b>specific structure<\/b> for its directories and files. Familiarize yourself with the <b>MVC <\/b>(Model-View-Controller) <b>architecture <\/b>and where to locate routes, controllers, models, and views within your project:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2024\/03\/f99cddad-c570-496e-9b83-1dbfc3896fb1.jpg\" alt=\"Exploring Laravel's structure in the file manager\"><\/div><p class=\"no-margin\">\n<\/p><h2 id=\"h_3bf9ac6270\">Configuring Your Laravel Environment<\/h2><p class=\"no-margin\">Edit the <b>.env<\/b> file in your Laravel <b>project root<\/b> to configure your application environment, such as database connections, mail drivers, and more:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2024\/03\/8a4b986f-4c22-4d25-895c-87a185d0868b.jpg\" alt=\"Editing the .env file in Laravel's project root folder\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Ensure you&rsquo;ve set an application key using the <b><code>php artisan key:generate<\/code><\/b> command, which is critical for securing your Laravel application:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2024\/03\/b36d67a8-6611-49b7-bbf3-e304c3a0d86e.jpg\" alt=\"Setting an application key for security\"><\/div><p class=\"no-margin\">\n<\/p><h2 id=\"h_a51fe045d4\">Managing Your Laravel Project with Composer<\/h2><p class=\"no-margin\">Use <b><a href=\"\/support\/5723772-how-to-connect-to-your-vps-via-ssh\" target=\"_blank\" class=\"intercom-content-link\">SSH<\/a><\/b> to connect to your server. You might need terminal access to run Composer commands directly in your project directory. To access the default project, connect through SSH with a username user and password you have set during template installation.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Within your project directory, you can use Composer to manage dependencies. For example, to update your Laravel project dependencies, run <b><code>composer update<\/code><\/b>:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2024\/03\/c80084fc-6843-43bf-b37e-d09c36987548.jpg\" alt=\"Updating your Laravel project dependancies via Composer\"><\/div><p class=\"no-margin\">\n<\/p><h2 id=\"h_ef321cb36a\">Running Migrations and Seeding Database<\/h2><p class=\"no-margin\">Run <b><code>php artisan migrate<\/code><\/b> to migrate your database using Laravel&rsquo;s migration system.<\/p><p class=\"no-margin\">If you have database seeds set up, run <b><code>php artisan db:seed<\/code><\/b> to populate your database with initial data.<\/p><div class=\"intercom-interblocks-callout\" style=\"background-color: #e3e7fa80;border-color: #334bfa33\">\n<p class=\"no-margin\">If you want Laravel to run on your<b> domain<\/b>, point it to your VPS IP address, <b><a href=\"\/support\/4805490-how-to-change-your-vps-hostname\" target=\"_blank\" class=\"intercom-content-link\">change the server hostname<\/a><\/b>, and reinstall the server &#128161; <\/p>\n<\/div><p class=\"no-margin\">The <b>Ubuntu 24.04 64bit with Laravel<\/b> VPS template provides a convenient starting point for Laravel developers. By leveraging the power of CloudPanel and Composer, you can focus on developing your application instead of worrying about server setup and maintenance. Remember, Laravel is a framework that rewards those who take the time to learn its intricacies and best practices.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">For more detailed guides on Laravel development, refer to the <b><a href=\"https:\/\/laravel.com\/docs\/11.x\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">official Laravel documentation<\/a><\/b>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting started with the Laravel VPS template at Hostinger<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[206],"tags":[],"class_list":["post-529","post","type-post","status-publish","format-standard","hentry","category-vps-os-and-templates"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/9070980-how-to-use-the-laravel-vps-template-at-hostinger\/","default":1}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=529"}],"version-history":[{"count":1,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/529\/revisions"}],"predecessor-version":[{"id":2509,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/529\/revisions\/2509"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}