> **New in 2026 — managed Static Hosting**: DeployHQ now offers [Static Hosting](https://www.deployhq.com/hosting/static) — fully-managed deployment to Cloudflare's edge for Astro and other static sites, no server to provision. The walkthrough below covers BYO-server deployment, which remains fully supported.

**Prerequisites:**

- A hosted server with Node.js and npm installed
- An [Astro](https://astro.build/) project ready for deployment
- A DeployHQ account

**Using DeployHQ for Astro Deployments**

DeployHQ simplifies the deployment process for Astro sites, automating builds and deployments.

**Creating a DeployHQ Project**

1. **Sign up and log in** to your DeployHQ account
2. **Create a new project:**
    - Go to **Projects** > **New Project**
    - Follow the wizard to connect your Git repository

**Configuring a Deployment Server**

1. **Create a new server:**
    - Go to **Servers** > **New Server**
    - **Name** the server
    - **Select SSH** as the protocol
    - Enter the **Hostname** (server IP address)
    - Set the **Username** (e.g., `deployhq`)
    - **Enable SSH key authentication:**
        - On your server, run:

```bash
su - deployhq
mkdir ~/.ssh
chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys
```
- Paste DeployHQ's public SSH key into the file
- Save and close the file
- Set permissions: `chmod 600 ~/.ssh/authorized_keys`
- **Set the Deployment Path:** Specify the directory where your Astro project will be deployed
- **Enable zero-downtime deployments:** This ensures smooth deployments without downtime
- **Set the Environment:** Enter `production`
- **Enable automatic deployment:** This triggers a deployment whenever there's a code change
- **Save the configuration**

**Configuring Build Commands**

1- **Create new Commands in the Build Pipeline:**

```bash
# Install dependencies
cd %path% && npm install

# Build the Astro project
npm run build
```

2- **Create new SSH Commands:**

```bash
# If using a process manager like PM2
pm2 restart astro-app

# If using nginx, you might need to reload it
sudo systemctl reload nginx
```

**Deploying Your Astro Project**

1. **Click "Deploy Project"** in the header
2. **Select the server and revision** to deploy
3. **Click "Deploy"** to initiate the deployment process

**Additional Tips**

- **Configure environment variables:** Use DeployHQ's configuration files to securely store sensitive information like API keys or environment-specific settings
- **Static file handling:** Ensure your server is configured to serve the static files from the `dist` directory (Astro's default build output directory)
- **Configure build options:** You can customize the build command based on your Astro configuration (e.g., `astro build --base=/subdirectory`)
- **Monitor deployments:** Keep track of deployment statuses and logs to identify and resolve issues promptly

**Important Astro-Specific Considerations**

- Ensure your server is configured to handle static files correctly
- If using SSR, make sure your server is set up to handle Node.js applications
- Consider using adapter-specific deployment configurations if using Astro SSR adapters (like `@astrojs/vercel` or `@astrojs/netlify`)

By following these steps and customizing the configuration to your specific needs, you can effectively automate your Astro deployments with DeployHQ, ensuring smooth and reliable updates to your website.

----------
_Want to learn more about deployment or Astro? Check out our [documentation](https://www.deployhq.com/support) or [contact our support team](https://www.deployhq.com/contact) for assistance._