If you already have a Linux server, you store an SSH login in MainPath, and from then on MainPath takes care of the setup and the deployments; it does not matter which provider the server runs with.
What the server needs to provide
The server must be reachable over SSH and have a user MainPath can work with, for example deploy or root. If it sits behind a firewall or NAT, connect it through a network tunnel; the host may then be an internal address. For authentication we recommend an SSH key pair instead of a password; if you do not have one yet, follow the instructions under Create an SSH key.
Registering the server in MainPath
- Open Servers in the sidebar, click Add server, and choose SSH.
- Enter the server’s IP address or hostname under Host.
- Leave Port at
22unless your server offers SSH on a different port. - Enter the prepared user under User.
- Under Authentication, choose SSH key (recommended) and paste the complete private key, including the
BEGINandENDlines. Alternatively, you can store a password. - Optionally enable Monitor server, Configure firewall, and Access via tunnel. The firewall limits SSH to selected addresses; details are under Servers. Behind a firewall or NAT, choose the network tunnel.
- Save. The server is available when creating and editing projects.
Your own key is only needed for the initial setup. During that setup MainPath generates a deploy key of its own, adds it to the authorized_keys of the user, and works with that key from then on.
What happens on the first deployment
Once the server is assigned to a project and the first pipeline runs, MainPath sets it up with Ansible: it installs Docker and Traefik as the reverse proxy and then applies the project configuration with backend, browser app, homepage, and database, depending on what your project contains. How the pipeline rolls out dev and production afterwards is described under Git workflow and deployment.
For requests to reach Traefik, the DNS records of your domain must point to the server.