{"id":578,"date":"2023-12-20T11:43:17","date_gmt":"2023-12-20T11:43:17","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2023\/12\/20\/8727597-how-to-install-composer-locally-at-hostinger\/"},"modified":"2025-08-27T06:48:04","modified_gmt":"2025-08-27T06:48:04","slug":"8727597-how-to-install-composer-locally-at-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/8727597-how-to-install-composer-locally-at-hostinger\/","title":{"rendered":"How to Install Composer Locally at Hostinger"},"content":{"rendered":"<p class=\"no-margin\">Both <b><a href=\"https:\/\/getcomposer.org\/\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">PHP Composer<\/a><\/b> version 1 and 2 are pre-installed in all of our <b><a href=\"https:\/\/hostinger.com\/hosting-web\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Web<\/a> <\/b>and <b><a href=\"https:\/\/hostinger.com\/cloud-hosting\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Cloud<\/a><\/b> hosting plans at the server level. If you upload a project from your local or remote repository and want to run the command <b><code>composer update<\/code> <\/b>or <b><code>composer self-update<\/code><\/b>, you will need to install Composer locally, that is, on your hosting. You can easily do so by following the steps below &#128071;  <\/p><div class=\"intercom-interblocks-callout\" style=\"background-color: #e3e7fa80;border-color: #334bfa33\">\n<p class=\"no-margin\">While <b>Composer 1<\/b> is discontinued, you can see how each version is used<b> <a href=\"https:\/\/support.hostinger.com\/ens\/articles\/5792078-como-usar-composer\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">here<\/a> &#128161; <\/b><\/p>\n<\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">1. <b><a href=\"\/support\/1583245\" target=\"_blank\" class=\"intercom-content-link\">Connect to your hosting plan via SSH<\/a><\/b>.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">2. In your command console, be sure to go to the <b>root folder<\/b> where you are going to deploy your project. In most cases, this folder follows the path:<\/p><pre><code>domains\/u123456789\/domain.tld\/public_html\/<\/code><\/pre><p class=\"no-margin\">To check the path of your current location, run this command: <\/p><pre><code>pwd<\/code><\/pre><p class=\"no-margin\">For more information, refer to this guide: <b><a href=\"\/support\/5822386-common-ssh-commands\" target=\"_blank\" class=\"intercom-content-link\">Common SSH Commands<\/a><\/b>&#8203;<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">3. Once you are in your project folder, go here: <b><a href=\"https:\/\/getcomposer.org\/download\/\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Download Composer<\/a><\/b> and find this section:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/12\/4fe80994-c79e-457f-b51e-98df39dc13fe.jpg\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Run each command one by one to install Composer locally. Remember to run each command one by one and press enter each time. It should look something like this:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/12\/1eb28519-0fdf-4c3f-8813-5ee127cc02ec.jpg\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">4. Run <b>composer update <\/b>for the <b>local composer file<\/b> that you have previously downloaded, that is, the <b>composer.phar<\/b> file<br>&#8203;<br>Make sure you are located in the folder where <b>composer.phar <\/b>and <b>composer.json<\/b> are stored (you can see the listing with the <code>ls<\/code> command), and run any of the following commands:<\/p><pre><code>&#8203;&#8203;php .\/composer.phar update<\/code><\/pre><p class=\"no-margin\">or<\/p><pre><code>&#8203;php .\/composer.phar self-update&#8203;<\/code><\/pre><div class=\"intercom-container\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/12\/015e380e-eba2-4777-b70a-389c390c6878.jpg\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">This will start the package updating process. After a few moments, if everything is correct, you will receive a result similar to this:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/12\/7e534cbd-b2bb-42e5-8d72-94e738b837d1.jpg\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">And that&rsquo;s it! By following the above steps, you can install Composer locally and execute the installation of your project packages successfully!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing and using Composer 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":[235],"tags":[],"class_list":["post-578","post","type-post","status-publish","format-standard","hentry","category-ssh-connection-and-ssh-keys"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/8727597-how-to-install-composer-locally-at-hostinger\/","default":1},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/support\/8727597-como-instalar-composer-localmente-en-hostinger\/","default":0}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/578","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=578"}],"version-history":[{"count":1,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/578\/revisions"}],"predecessor-version":[{"id":2672,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/578\/revisions\/2672"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}