Header

Deploy Web Applications Directly From Slack with DeployHQ

Tips & Tricks and Tutorials

Post Image

You've built a blazing-fast web application, and now you want an equally fast way to deploy it. What if you could trigger deployments right from your team's Slack channel? This guide shows you how to set up automated deployments for your web application site using DeployHQ and control everything through Slack. Perfect for teams who want to streamline their deployment workflow!

What You'll Need

  • A web application in a Git, SVN, or Mercurial repository
  • A Slack workspace
  • A server or hosting platform, like DigitalOcean
  • A DeployHQ account (starts at $9/month, with a 10-day free trial)

Quick Overview

We'll cover two main parts:

  1. Setting up automated deployments for your web application with DeployHQ
  2. Connecting DeployHQ to Slack for deployments with simple Slack commands

Let's get your deployments sorted in under 15 minutes!

Setting up DeployHQ

As an example we will deploy a simple Astro site to a server that we have SSH access to. Although this example is for Astro, the same steps apply to most Node.js based web applications. If you're not using Astro don't worry, we have over 25 guides for different frameworks available!

If you want to follow along, you can create the same Astro site that we will deploy by running the following commands:

npx create-astro@latest -y

The output will look like this:

Deploy from Slack with DeployHQ

Then simply push it to a Github repository of your choice. If you need help with that, we have a few awesome guides to help you get started here:

Once you have a repository and your server credentials, you can proceed with setting up DeployHQ.

Connecting Your Repository and Server

Step 1: Create a New Project

  1. Log in to your DeployHQ account
  2. Click "New Project" in the top right
  3. Enter a name for your project (e.g., "Astro Site")
  4. Select one of the options for your repository provider and follow the instructions to connect your repository.

Connecting repository to DeployHQ

Step 2: Configure Your Server

  1. Go to "Servers & Groups" in the left sidebar
  2. Click "New Server"
  3. Pick SSH and fill in the server details:
    • Name: Give your server a descriptive name (e.g., "Production")
    • Hostname: Your server's IP address or domain
    • Port: Usually 22
    • Username: Your SSH username
    • Authentication: Choose between password or SSH key
    • Deployment Path: The directory where your site will be deployed (e.g., /var/www/html)
  4. Click "Create Server"
  5. DeployHQ will test the connection - if successful, you'll see that the server is getting created

Adding a server in DeployHQ

Step 3: Configure Build Pipeline

We are basically done here, just one last step is missing. Astro sites need to be built before they are deployed. To do that, we first need to run npm install to install the dependencies and then npm run build to build the site. Of course, DeployHQ makes this super easy for us with Build Pipelines.

Go to your project and click on "Build Pipeline" in the left sidebar.

  1. Click "New Command"
  2. Fill in the details:
    • Description: Install and build
    • Command: npm install && npm run build && rm -rf ./node_modules
  3. Click "Create Build Command"

This will be executed before the deployment on a secure build server. Since Astro is static, we don't need to keep the node_modules folder. This will make our deployment a bit smaller and a lot faster!

Step 4: Test Deployment

Houston, we are ready to deploy!

Before we automate the deployment with Slack, let's test it manually once. Again, go to your project and click on "Deployments" in the left sidebar.

  1. Click "New Deployment"
  2. Select the branch you want to deploy
  3. Click "Deploy"

You can follow the progress of the deployment in the DeployHQ dashboard. Once it's done, you can check your deployment folder to see if the deployment was successful.

Testing a deployment in DeployHQ

Setting Up the Slack Integration

Getting started with DeployHQ's Slack integration is surprisingly simple:

1- Create a DeployHQ Integration

  • Go to your project's Integrations section
  • Click "New Integration"
  • Select Slack from the service picker

2- Authorize the DeployHQ App

  • You'll be redirected to Slack
  • Choose which channel to send notifications to
  • Authorize the app for your workspace and user

3- Configure Deployment Triggers - Choose when to trigger notifications - Select specific servers or apply to all - Customize your notification preferences

Notifications are not the only thing the DeployHQ Slack integration can do! DeployHQ also allows you to deploy directly from Slack. So let's do that now!

Trying it out in Slack

The command is /deployhq deploy <your-project-permalink>. The perma-link can be found in the URL of your project or in the settings of your project.

If you need more help, we have a dedicated Slack guide for you.

Why Choose DeployHQ's Slack Integration?

If you (or your boss) still need some convincing, here are some more reasons why DeployHQ's Slack integration is a game-changer:

  • Deploy without leaving Slack, less context switching
  • Real-time deployment visibility for the whole team
  • Secure permissions management through Slack
  • Quick setup (usually under 5 minutes)
  • Works with any hosting provider
  • Very easy, even for non-tech-savvy team members

Best Practices

Of course, there are some best practices to keep in mind:

1- Channel Organization

  • Create dedicated deployment channels
  • Use channel naming conventions (e.g., #deployments-prod, #deployments-staging)

2- Permission Management

  • Only give deployment access to necessary team members

3- Notification Setup - Configure meaningful notification triggers - Avoid notification fatigue with selective alerts

Getting Started

Ready to supercharge your deployments with DeployHQ and Slack? Here's how:

  1. Sign up for DeployHQ (10-day free trial available)
  2. Connect your repository (GitHub, GitLab, or Bitbucket)
  3. Set up your deployment servers
  4. Add the Slack integration
  5. Start deploying with simple slash commands!

FAQ

Is the Slack integration included in all DeployHQ plans?

Yes! The Slack integration is available on all DeployHQ plans, starting from $9/month.

Can I control who can deploy through Slack?

Absolutely! DeployHQ's permission system carries over to Slack commands, ensuring only authorized team members can trigger deployments.

What happens if a deployment fails?

You'll receive immediate notifications in Slack about any deployment issues, complete with error details and troubleshooting links.

Can I use this with any hosting provider?

Yes! DeployHQ works with any hosting provider that supports SSH access, making it incredibly versatile.

Can I change the message that is sent to Slack?

Yes! You can customize the message that is sent to Slack by clicking on "Edit" next to the integration and then on "Message Format".

Conclusion

Whether you're a small startup or a large enterprise, bringing deployments into Slack can significantly streamline your workflow. With DeployHQ's robust platform backing every deployment, you get the perfect blend of simplicity and power.

Ready to make your deployments faster and easier? Start your free trial with DeployHQ today!

A little bit about the author

I'm Viktor, from the DeployHQ dev team. Making our product a bit better, one step at a time!

Tree

Proudly powered by Katapult. Running on 100% renewable energy.