How to Use Composer on Your Hosting Account

Composer is the standard dependency manager for PHP, and it's fully supported on your dotCanada hosting account. You can install it via SSH or the cPanel Terminal and use it to manage packages for any PHP project.

Installing Composer

  1. Connect to your account via SSH or the cPanel Terminal.
  2. Navigate to your home directory: cd ~
  3. Download the Composer installer: php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  4. Run the installer: php composer-setup.php
  5. Remove the installer: php -r "unlink('composer-setup.php');"
  6. Move Composer to a global location: mv composer.phar ~/bin/composer

Using Composer

Once installed, navigate to your project directory and run:

  • composer install - Install dependencies from composer.json
  • composer update - Update all dependencies to their latest allowed versions
  • composer require vendor/package - Add a new package to your project
  • composer dump-autoload - Regenerate the autoloader

Tips for Shared Hosting

  • Use php composer.phar if composer isn't globally available.
  • Add --no-dev to skip development-only dependencies in production.
  • Make sure you're using the correct PHP version by running php -v first.

Composer is used by frameworks like Laravel, Symfony, and many others supported on dotCanada. If you run into any issues, contact our support team for help.

100% Satisfaction Guarantee

We're so confident you'll love dotCanada that we offer a 30-day money-back guarantee. Not satisfied? Get a full refund, no questions asked.

Ready to Get Started?

Join thousands of Canadian website owners who trust dotCanada for reliable, fast web hosting.

Get Started Today