Deploying your code to a server managed by <a href="https://ploi.io/" target="_blank">Ploi</a> is straightforward with DeployHQ.

Ploi is a server management platform that provisions and manages servers on cloud providers like DigitalOcean, Vultr, Hetzner, and others. It handles server setup, SSL, databases, and site configuration — while DeployHQ handles the actual code deployment.

**Important:** Ploi disables password-based SSH by default. You will need to use SSH key authentication when connecting from DeployHQ.

Firstly, you'll need to set up your DeployHQ project, then connect to your Ploi-managed server.

## Setting up your project

Head to the **Projects** screen in DeployHQ, then click the **New Project** button to get started.

You'll be prompted to enter a name for your project, then select where your repository is hosted.

{screenshot: 9}

Next, click **Create project** and you'll be taken to a screen where you can log in with your repository hosting account to authorise access and then choose your repository.

* [Adding a Bitbucket repository](Article: #17)
* [Adding a Codebase repository](Article: #19)
* [Adding a GitHub repository](Article: #21)
* [Adding a GitLab repository](Article: #23)
* [Adding a repository manually](Article: #25)

## Setting up your Ploi server

Once you've configured your repository, you'll need to connect to your Ploi-managed server.

First, add DeployHQ's public SSH key to your server via the Ploi dashboard. Go to your server in Ploi, then navigate to **SSH Keys** and paste in the DeployHQ public key shown on the server configuration page in DeployHQ.

Make sure your server's firewall (configured in Ploi under **Server > Firewall**) allows connections from DeployHQ's IP addresses. For the list of IPs to allow, refer to <a href="https://www.deployhq.com/support/faq/our-ip-ranges" target="_blank">our IP ranges article</a>.

Head to **Servers & Groups** in DeployHQ, and click the **New Server** button. Choose **SSH/SFTP** as the protocol.

Enter the following details:

- **Hostname**: Your server's IP address (found in the Ploi dashboard under your server's overview)
- **Username**: `ploi` (the default SSH user Ploi creates on all managed servers)
- **Port**: `22`

Then set the **Deployment path**. Ploi uses the following directory structure:

- **Site root**: `/home/ploi/yourdomain.com/`
- **Web root**: `/home/ploi/yourdomain.com/public/`

If you're deploying a full application (Laravel, Node.js, etc.), set the deployment path to `/home/ploi/yourdomain.com/`. If you're deploying only the public-facing files, use `/home/ploi/yourdomain.com/public/`.

Under **Deployment options**, you can enable automatic deployments and set a **Deployment subdirectory** if needed.

Click **Create Server** to save, then proceed to your first deployment.

## Run your first deployment

By default, DeployHQ will upload your entire repository on the first deployment, since there's no previously deployed commit to compare against.

If your files are already on the server and up to date with the latest commit, you can skip that initial upload:

* [Don't deploy your whole repository on the first deployment](Article: #129)

Otherwise, follow this guide to start your first deployment — after the first run, only changed files will be uploaded:

* [Running your first deployment](Article: #43)

That's it! You've now set up automated deployments to your Ploi-managed server.

## Further reading

* Compile assets with the [Build pipeline](Article: #301)
* Run commands on your server with [SSH commands](Article: #57)
* Prevent certain files from uploading using [Excluded files](https://www.deployhq.com/support/excluded-files)
* Keep sensitive config out of your repository using [Config files](Article: #47)
* Notify your team and integrate with other services via [Integrations](Article: #327)

----------

_Need help with your deployment? Check out our [documentation](https://www.deployhq.com/support) or [contact our support team](https://www.deployhq.com/contact) for assistance._