{"id":6207,"date":"2020-12-07T07:21:24","date_gmt":"2020-12-07T07:21:24","guid":{"rendered":"https:\/\/truehost.co.ke\/support\/?post_type=ht_kb&#038;p=6207"},"modified":"2024-06-07T13:03:13","modified_gmt":"2024-06-07T13:03:13","password":"","slug":"how-to-upload-and-host-a-laravel-project-to-the-cpanel","status":"publish","type":"docs","link":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\/","title":{"rendered":"How to upload and host a Laravel project in the cPanel."},"content":{"rendered":"\n<p class=\"has-text-align-left\">Laravel directory structure needs special attention as far as hosting in the cPanel is concerned. Proper uploading and hosting needs to be done to guarantee security of the application directories and files. This article gives a step by step guide on how to upload a Laravel app from a development environment like a local host to the cPanel for production.<\/p>\n\n\n\n<p><strong>Step I<\/strong><\/p>\n\n\n\n<p>Zip your project files so that you can upload a single zip file. After zipping the project files, login to the cpanel and create a new folder in the same level as the&nbsp; \u201c<strong>public_html<\/strong>\u201d directory, as follows. Let us name it \u201c<strong>mylaravel<\/strong>\u201d;<\/p>\n\n\n\n<p>To ensure that you are in the same level as<strong> public_html, <\/strong>start by clicking on the <strong>\/home\/domain username. <\/strong>Then use the \u201c<strong>new folder<\/strong>\u201d icon to create the folder.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/9hK-uwVfhMXu7PnHfKavUmNbfW85rcvSFo0gaLHbgLNZKdpY3pBdByMfB-ray1dOGPiFsUfW6YW7ONr-qWzD_Qfz2oS90TX5SFZ1_c9cFr0648B3av7FXhipBoPjpWFSKtox8Fcj\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step II<\/strong><\/p>\n\n\n\n<p>After creating the \u201c<strong>mylaravel<\/strong>\u201d directory, open the directory and upload your zip file&nbsp; in there.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/aI0GvBr6w4eesuf-9DnL3AM4ZxkiN8XgswMfFdL_Xyh2xTmrBNVcTRzGN5ovA9e5UrBuoHiWZvoirbazWCwbYd92BwTKmc6Gn8EYY6K2AtdmtSe0gaEnR4ODO1OMG6CGtwODPne9\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step III<\/strong><\/p>\n\n\n\n<p>Extract the zip files and move the contents of the \u201c<strong>public<\/strong>\u201d folder to <strong>public_html.&nbsp;<\/strong><\/p>\n\n\n\n<p>This is how to move:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Open the app folder (<strong>mylaravel<\/strong>)<\/li><li>Select All the content.<\/li><li>Click on the Move button, that is among the top menu.<\/li><li>Enter the destination path, in this case <strong>\/home\/korirxyz\/public_html<\/strong><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/8ojfDUsm0S5NghJnhwjpCIfzM2q-sCK6FIJYRU7LjvkdytfDSCJHSV4Bp4rUItmWkRGpfuTWCgIejb4Gve6QqDTwGfDHRdGhem-doaJW1UyJ_POmkBlqBDz8mjG28DdN7wno45lI\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step IV<\/strong><\/p>\n\n\n\n<p>In the public_html directory, edit the <strong>index.php <\/strong>&nbsp;so that it includes the \u201c<strong>mylravel<\/strong>\u201d directory path, as follows;<\/p>\n\n\n\n<p><strong>Part 1<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/VLjVtXyPENubpNOxgIKRf5pO08BeL8vm8bT_1F1x-DRrUrjMSHqkxb4tNJ2ak1OChQ6-lFw8IdYFdsnBHcfbt8oSJ4EhoHE9hZfi88XSLgHNlssQ5yVgLs8_GKO4wCEcwudV_K2i\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Part 2<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/wmNBGnd_qAv6HXLLz8DQkngPeejLo88CAUrIS1cogYGQUcX8YnCmuMYGSQctBluCW2ATh-txrd1zso6xQwepOYyTq6IUTzTIIBOJnPEgLzUm-7136LYLyHFd0RP59adr6XXkCLxR\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Finally<\/strong><\/p>\n\n\n\n<p>Now go to your browser and load the domain name, your Laravel app should be up and running.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravel directory structure needs special attention as far as hosting in the cPanel is concerned. Proper uploading and hosting needs to be done to guarantee security of the application directories and files. This article gives a step by step guide on how to upload a Laravel app from a development environment like a local host [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_category":[],"doc_tag":[],"class_list":["post-6207","docs","type-docs","status-publish","hentry"],"year_month":"2026-06","word_count":300,"total_views":"0","reactions":{"happy":"1","normal":"0","sad":"2"},"author_info":{"name":"kenneth","author_nicename":"kenneth","author_url":"https:\/\/truehost.com\/support\/author\/kenneth\/"},"doc_category_info":[],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to upload and host a Laravel project in the cPanel. -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to upload and host a Laravel project in the cPanel. -\" \/>\n<meta property=\"og:description\" content=\"Laravel directory structure needs special attention as far as hosting in the cPanel is concerned. Proper uploading and hosting needs to be done to guarantee security of the application directories and files. This article gives a step by step guide on how to upload a Laravel app from a development environment like a local host [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-07T13:03:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/lh6.googleusercontent.com\/9hK-uwVfhMXu7PnHfKavUmNbfW85rcvSFo0gaLHbgLNZKdpY3pBdByMfB-ray1dOGPiFsUfW6YW7ONr-qWzD_Qfz2oS90TX5SFZ1_c9cFr0648B3av7FXhipBoPjpWFSKtox8Fcj\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\\\/\",\"name\":\"How to upload and host a Laravel project in the cPanel. -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/lh6.googleusercontent.com\\\/9hK-uwVfhMXu7PnHfKavUmNbfW85rcvSFo0gaLHbgLNZKdpY3pBdByMfB-ray1dOGPiFsUfW6YW7ONr-qWzD_Qfz2oS90TX5SFZ1_c9cFr0648B3av7FXhipBoPjpWFSKtox8Fcj\",\"datePublished\":\"2020-12-07T07:21:24+00:00\",\"dateModified\":\"2024-06-07T13:03:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\\\/#primaryimage\",\"url\":\"https:\\\/\\\/lh6.googleusercontent.com\\\/9hK-uwVfhMXu7PnHfKavUmNbfW85rcvSFo0gaLHbgLNZKdpY3pBdByMfB-ray1dOGPiFsUfW6YW7ONr-qWzD_Qfz2oS90TX5SFZ1_c9cFr0648B3av7FXhipBoPjpWFSKtox8Fcj\",\"contentUrl\":\"https:\\\/\\\/lh6.googleusercontent.com\\\/9hK-uwVfhMXu7PnHfKavUmNbfW85rcvSFo0gaLHbgLNZKdpY3pBdByMfB-ray1dOGPiFsUfW6YW7ONr-qWzD_Qfz2oS90TX5SFZ1_c9cFr0648B3av7FXhipBoPjpWFSKtox8Fcj\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to upload and host a Laravel project in the cPanel.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"name\":\"\",\"description\":\"Help In a Click\",\"publisher\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/truehost.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\",\"name\":\"Truehost Kenya\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"width\":240,\"height\":48,\"caption\":\"Truehost Kenya\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to upload and host a Laravel project in the cPanel. -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\/","og_locale":"en_US","og_type":"article","og_title":"How to upload and host a Laravel project in the cPanel. -","og_description":"Laravel directory structure needs special attention as far as hosting in the cPanel is concerned. Proper uploading and hosting needs to be done to guarantee security of the application directories and files. This article gives a step by step guide on how to upload a Laravel app from a development environment like a local host [&hellip;]","og_url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\/","article_modified_time":"2024-06-07T13:03:13+00:00","og_image":[{"url":"https:\/\/lh6.googleusercontent.com\/9hK-uwVfhMXu7PnHfKavUmNbfW85rcvSFo0gaLHbgLNZKdpY3pBdByMfB-ray1dOGPiFsUfW6YW7ONr-qWzD_Qfz2oS90TX5SFZ1_c9cFr0648B3av7FXhipBoPjpWFSKtox8Fcj","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\/","url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\/","name":"How to upload and host a Laravel project in the cPanel. -","isPartOf":{"@id":"https:\/\/truehost.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\/#primaryimage"},"image":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\/#primaryimage"},"thumbnailUrl":"https:\/\/lh6.googleusercontent.com\/9hK-uwVfhMXu7PnHfKavUmNbfW85rcvSFo0gaLHbgLNZKdpY3pBdByMfB-ray1dOGPiFsUfW6YW7ONr-qWzD_Qfz2oS90TX5SFZ1_c9cFr0648B3av7FXhipBoPjpWFSKtox8Fcj","datePublished":"2020-12-07T07:21:24+00:00","dateModified":"2024-06-07T13:03:13+00:00","breadcrumb":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/truehost.com\/support\/knowledge-base\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\/#primaryimage","url":"https:\/\/lh6.googleusercontent.com\/9hK-uwVfhMXu7PnHfKavUmNbfW85rcvSFo0gaLHbgLNZKdpY3pBdByMfB-ray1dOGPiFsUfW6YW7ONr-qWzD_Qfz2oS90TX5SFZ1_c9cFr0648B3av7FXhipBoPjpWFSKtox8Fcj","contentUrl":"https:\/\/lh6.googleusercontent.com\/9hK-uwVfhMXu7PnHfKavUmNbfW85rcvSFo0gaLHbgLNZKdpY3pBdByMfB-ray1dOGPiFsUfW6YW7ONr-qWzD_Qfz2oS90TX5SFZ1_c9cFr0648B3av7FXhipBoPjpWFSKtox8Fcj"},{"@type":"BreadcrumbList","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-upload-and-host-a-laravel-project-to-the-cpanel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.truehost.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to upload and host a Laravel project in the cPanel."}]},{"@type":"WebSite","@id":"https:\/\/truehost.com\/support\/#website","url":"https:\/\/truehost.com\/support\/","name":"","description":"Help In a Click","publisher":{"@id":"https:\/\/truehost.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/truehost.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/truehost.com\/support\/#organization","name":"Truehost Kenya","url":"https:\/\/truehost.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","width":240,"height":48,"caption":"Truehost Kenya"},"image":{"@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/6207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/comments?post=6207"}],"version-history":[{"count":2,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/6207\/revisions"}],"predecessor-version":[{"id":6209,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/6207\/revisions\/6209"}],"wp:attachment":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/media?parent=6207"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_category?post=6207"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_tag?post=6207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}