Guide Web hosting

Can I use Composer on my web hosting?

Composer is available on PlanetNode web hosting. Learn how to install and update PHP packages for your website with Composer via SSH.

By Yvan Watchman Updated

Yes, Composer is available on our web hosting. You use it via SSH: log in to your account and run the composer command in your website's folder. You don't need to install Composer yourself.

What you need

  • A web hosting package from PlanetNode
  • SSH access to your account. Don't have it yet? Open a ticket at planetno.de/ticket.
  • An SSH client, such as the terminal on macOS and Linux or PowerShell on Windows

Using Composer

  1. Connect to your account via SSH. Use the same credentials as for DirectAdmin, or an SSH key (see How do I add SSH keys to my account?):
bash
ssh gebruikersnaam@jouwdomein.nl
  1. Check that Composer works:
bash
composer --version
  1. Go to the folder of your website or project:
bash
cd domains/jouwdomein.nl/public_html
  1. Install the packages from your composer.json:
bash
composer install

Want to add a new package? Use composer require, for example:

bash
composer require vendor/package

Good to know

Your account runs in an isolated environment (CageFS). You only see and manage your own files, and Composer works within your own home directory. You don't need root or sudo rights.

Tip

Use composer install --no-dev on your live website. That way only the packages your site needs are installed, without development tools.

Checking

After composer install, there is a vendor folder in your project and a composer.lock has been created or updated. Does your site load the packages via vendor/autoload.php? Open your website and check that everything works.

Common problems

  • A package requires a different PHP version. Use php -v to check which PHP version you're using via SSH and compare it with the package's requirements.
  • composer: command not found or you can't log in via SSH. SSH is then probably not yet enabled for your account. Open a ticket at planetno.de/ticket.

Additional resources

Did this article help you?

Did not find what you were looking for?

Open a ticket and our team will look into it with you. For a quick question, Discord works too.

Open a ticket Go to Discord