Skip to content

Deploy project to a production server

Ansible installation

Check, that you have Ansible v2.9.x (or later) is installed1:

ansible --version

# Outputs: ansible 2.9.x

Host name

Add a new host name with IP (or domain) address of your remote server to the Ansible inventory (usually, at /etc/ansible/hosts file) on your local machine:

[my_server] ansible_connection=ssh

SSH key

Be sure, you're working with a SSH key correctly:

  • Generate a new SSH key by command ssh-keygen on your local machine.
  • Add a public key part (with *.pub extension) into a bottom of ~/.ssh/authorized_keys file on your remote server.
  • Save a private key part on your local machine (usually, at ~/.ssh folder).

Deploy process

Run the built-in cgapp deploy2 command (from the root folder of your project):

cgapp deploy

# OR

cgapp deploy --use-config

  1. For more details instructions to install Ansible, please read the User Guide here

  2. Get more information about the cgapp deploy command here