Header

Deploying Your Code with DeployHQ: A Beginner's Guide

Tips & Tricks and Tutorials

Post Image

So, you've written some amazing code and you're ready to share it with the world? Great! Let's dive into how to deploy it effortlessly using DeployHQ. Even if you're new to deployment, don't worry - we'll break it down step-by-step.

What is DeployHQ?

DeployHQ is a powerful tool that simplifies the process of deploying your code to a server. It automates the deployment process, saving you time and reducing errors. In this guide, we'll focus on the most basic setup: deploying directly from your Git repository.

Step-by-Step Guide

1. Create a DeployHQ Account

2. Create a New Project

  • Once logged in, click on the "Create Project" button.
  • Give your project a name (e.g., "My First Deploy").
  • Select the source of your code. For this guide, choose "Git" (SVN and Mercurial are also supported).
  • Connect your Git repository (e.g., GitHub, GitLab, Bitbucket).

3. Configure Deployment Settings

  • Choose the branch you want to deploy from (usually master or main).
  • Select the deployment environment (e.g., production, staging).
  • Specify the server where you want to deploy your code. You'll need the server's IP address, username, and password (or SSH key).

4. Define SSH Commands (optional)

  • DeployHQ allows you to customize what happens before or after a deployment. You can leave it empty for now, or select the default actions (e.g., git pull, restart server). More info here.

5. Test Your Deployment

  • DeployHQ provides a preview deployment where you can see the changes before they go live. Use this to check everything is working as expected and the files that were changed are included. By default it will be an incremental deployment, which means that only the files that were changed will be updated.

6. Deploy to Production

  • Once you're satisfied with the preview, you can deploy your code to the production environment.

Additional Tips

  • Use SSH keys: For enhanced security, consider using SSH keys instead of passwords.
  • Set up config files: Store sensitive information like API keys or database credentials as config files, which are stored encrypted in transit and at rest.
  • Leverage deployment hooks: Customise the deployment process further with deployment hooks.
  • Explore advanced features: As you become more comfortable with DeployHQ, explore features like rollbacks, deployments by tag, and more.
  • Use the Build Pipeline: With Build Pipelines you can set up a build, which will consist of commands that you can define to run on our servers before starting a deployment.

Conclusion

Deploying your code doesn't have to be a complex process. With DeployHQ, you can automate the entire workflow and focus on building amazing software. This guide has covered the basics, but there's much more to discover. Experiment with different settings and features to find the perfect deployment process for your project. More info about Git Deployment.

Happy deploying!

A little bit about the author

Facundo is the CTO at DeployHQ. He oversees our software engineering team by day and, in his free time, enjoys hobbies such as cycling, spending time in nature, and the company of Bono 🐶

Tree

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