In this article, I’ll walk you through how to easily and automatically deploy code from your Git repository to your FTP server within minutes.
We generally advise using SSH over FTP, as FTP tends to come with some inconveniences that SSH doesn’t have. That said, using SSH isn’t always an option whereas FTP is almost universally available if you’re using shared hosting.
When you manually upload files to your test and/or live server(s) using an FTP client, you might frequently run into any of the following situations:
- You’ll have to manually keep track of which files have yet to be uploaded, which have already been uploaded, and which of those have been changed - introducing a window for potentially costly or frustrating mistakes.
- Uploading your entire site for every new version can take a long time when using FTP. Every file is uploaded individually, which introduces the risk of an “FTP connection time-out”, meaning only some of your files will have been updated.
- Deleting files via FTP is very slow: every file is processed individually rather than entire folders at once.
- Collaboration is nearly impossible. If you’re working with a team you’ll find yourself wondering who is going to upload the new version, or has this already been done? Does everyone get their individual FTP credentials for the target server?
We’ve also written an article outlining various methods of deploying code from Git to your server.
Before we get started
When you first start using Launchdeck to improve your deployment process and development workflow, it’s important that you’re already using Git, and have access to an FTP server that you wish to deploy code to. If you’re not already using Git, do yourself a favor and look into it! Git’s main website has some great resources to get you started.
We offer a free full-featured plan that allows you to deploy one project as often as you’d like!
Create a project
Once you've signed up for a new Launchdeck account, you can create your first project and link it to your Git account. All repositories within your account will be retrieved and shown as a list, from which you can now select the one you’d like to use.
Setup your build
The next step allows us to define commands which will be executed in an isolated docker container - this is the build step. You can use this step to, for example, compile assets, install dependencies, run tests, and everything in between.
All files generated using these build commands will be uploaded to your server. You’ll find more information on how to set up and use build commands in our build commands docs.
Configure a FTP server
Now let’s tell Launchdeck where to deploy the files.
Hit ‘+ new server’, select FTP, and enter the credentials to your server. Next, enter the path to which your files should be uploaded. Normally, this will be a directory like htdocs or public_html.
Deploy for the first time
We’re now ready to start our first deployment. Click ‘create new project’ to confirm the settings and add the project. In the project overview, you can now start the build. The code will be cloned from your repository and prepared for you to publish it. Hit ‘Publish’ and your code is live!
Check out the step by step video below to see Launchdeck in action deploying code from Git to an FTP server.
That’s all! By using Launchdeck to deploy, you’ll never have to manually upload a new version, or worry about forgetting a file again. Just hit “publish”, and Launchdeck will automatically upload all modified files to exactly the right place on your server.