bars icon
magnifying-glass icon

Phoenix

Deployment

Step 1. Create a service

To deploy a Phoenix application, click Create in the top-left corner of your Dashboard and choose Back-end app.

enter image description here

Step 2. Select the project to deploy

If you are logged in to Hostman with your GitHub, GitLab or Bitbucket account, at this point you will see the repository with your projects, including the private ones.

enter image description here

To access a different repository, click Connect another repository.

If you didn’t use your Git account credentials to log in, you’ll be able to access the necessary account now, and then select the project.

Step 3. Choose a server

Your Phoenix application must run on a specific cloud server. Choose the location and configuration of this server. You can upgrade it in the future.

enter image description here

Step 4. Configure the build settings

Next, the App customization window will appear.

enter image description here

First, select Elixir environment and then Phoenix from the list of frameworks.

The Build command and the Start command will be filled in automatically.

You can also use a bash script containing build commands to deploy your project.

To do this, instead of the command:

mix local.hex --force && mix local.rebar --force && mix deps.get && mix compile && cd assets && npm install && node node_modules/webpack/bin/webpack.js --mode production

enter the path to your script into the Build command field, for example:

./build.sh

The script would probably contain the following:

#!/usr/bin/env bash mix local.hex --force mix local.rebar --force mix deps.get mix compile cd assets npm install node node_modules/webpack/bin/webpack.js --mode production

If the project requires additional modules, you can enter them into the build command separated by &&, or by adding new lines to your script.

Step 5. Deploy

Click Deploy to start the build process.

Once it starts, you will enter the deployment log. The log contains all the debugging data you'll need. If there are any issues with the code, you will get warning or error messages in the log, specifying the cause of the problem.

Usually it takes some time to install the cloud server during the first deployment.

When the deployment is complete, you will receive an e-mail notification and also see a similar log entry:

enter image description here

All done!

Your project is up and ready.