React deployment guide
In this guide, you'll learn how to deploy a React app from your Git repository to your server.
Launchdeck automates your React deployments, allowing you to deploy changes directly from GitHub or Bitbucket to your server.
Prerequisites
Before you begin, you'll need:
- An React app stored in a GitHub or Bitbucket repository
- Access to the server hosting your app with FTP, SFTP, or SSH credentials
New to Launchdeck? Start your free trial and follow the steps below to deploy with Launchdeck. Start free trial →
Create a project
Let’s get started by creating a new project and linking your Git account. All repositories within your account will be retrieved and shown as a list, from which you can now select the one that you’d wish 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. Hit the button “Auto suggest build automation” and we will automatically suggest a build config based on the contents of your repository.
If you’re using the create-react-app you’ll only need to add the following build commands. Please note that there also is a input and output file specified. This will be used to cache the node_modules folder and prevent you from installing the dependencies from scratch with every deployment.
This will save you a ton of time!
Different versions of create-react-app require different versions of node to compile. As the time of writing, node version 16 is appropriate for newly instantiated create-react-app projects (hence use-node-version 16).
build:
- use-node-version 16
- cmd: npm install
input: package.json
output: node_modules
- npm run build
To run tests (defined as the test script in package.json) add the following command:
npm test
All files generated using these build commands will be uploaded to the server. In the case of our create-react-app you'll want to deploy just the browser bundle which is generated inside the build directory. To "pull" everything inside this folder up to the working directory and delete everything else, use:
pull-up build

You’ll find more information on how to set up and use build commands on our docs page about build automation.
Configure a server
Now let’s tell Launchdeck where to upload your React application. In this example, we’ll upload the React files to your server using SSH.
A major advantage of SSH is that it allows for commands to be executed on your server, including the creation of symlinks. This enabled Launchdeck to publish new versions of your project without any downtime at all. The way this works is by adding an entirely new directory for each new version, to which a symlink from your server’s webroot will be created or updated once you wish to publish this new version.
Setting up a server connection is covered in the pages below:
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 React app is live!
If we then commit changes to our repository, the commit will automatically appear in your project overview where you’ll be able to upload and publish your new version with the push of a button. If anything goes wrong, you can simply roll back to the latest working version.
That’s all! By using Launchdeck to deploy your React application, you’ll never have to upload a new version or run commands manually. Just hit “publish”, and Launchdeck will deploy your app with zero downtime.
