# How to use Composer on Kualo servers

> Kualo servers have both Composer 1.x and 2.x pre-installed so you can use whichever version your project needs.

Source: https://www.kualo.com/knowledgebase/dev-cli/how-to-use-composer-on-kualo-servers
Updated: 2026-06-04

---

Composer is a dependency manager for PHP that handles your project's libraries, packages, and class autoloading. Kualo servers have both major versions pre-installed so you can use whichever your project needs.

| Command | Version |
|---|---|
| `composer` | Composer 1.x |
| `composer2` | Composer 2.x |

Type either command after [logging in via SSH](/knowledgebase/) to get started.

## Choosing the right Composer version

Check your project's documentation or `composer.json` to confirm which version it requires. Most modern projects work best with Composer 2.x, which offers better performance and stricter dependency resolution. Some older projects may still depend on Composer 1.x.

## Setting up a Bash alias

If your scripts or tooling call `composer` directly but your project needs version 2.x, you can create a Bash alias so that `composer` points to `composer2`.

1. Connect to your account via SSH.
2. Open your `.bashrc` file in a text editor. If the file does not exist, this command will create it:

```bash
nano ~/.bashrc
```

3. Scroll to the bottom of the file and add the following line:

```bash
alias composer='/usr/local/bin/composer2'
```

4. Save the file and exit the editor (`Ctrl+O`, then `Ctrl+X` in nano).
5. Apply the change to your current session:

```bash
source ~/.bashrc
```

The alias will now be active. Any new SSH session will also pick it up automatically.

:::tip
If you only need the alias for a single session, you can run the `alias` command directly in the terminal without editing `.bashrc`.
:::

## Specifying the Composer binary path in your application

Some applications let you configure the path to the Composer binary directly in their settings. If yours does, set it to:

```
/usr/local/bin/composer2
```

This tells the application to use Composer 2.x without requiring a Bash alias.

---

_Source: Kualo Knowledgebase — https://www.kualo.com/knowledgebase/dev-cli/how-to-use-composer-on-kualo-servers · © Kualo Ltd._
