π¬π§ Installing Trellis on remote servers
TOC
Follow these steps
- Install Ubuntu
- Setup SSH access
- Configure
wordpress_sites
andvault
- Provision with Trellis
- Deploy with Trellis
- Install WordPress
1. Install Ubuntu
Start with a stock Ubuntu 18.04 LTS
Everything default, except:
- location: Other -> Europe -> Netherlands
- hostname: client-production or client-staging (e.g. fitchef-production)
- realname: Client company name
- username: client-name
- password: [generated random password]
- Partition disks: Guided - use entire disk and setup LVM
- Updates: Automatic security updates
- Software selection: standard system utilities + OpenSSH server
2. Setup SSH access
Logged in to the just set up server as the user according to the given username.
Paste public key Mac: public key of local vagrant cat ~/.ssh/id_rsa.pub
Windows: public key of local vagrant VM. In running VM cat ~/.ssh/id_rsa.pub
Verify that you can login to the server with SSH.
3. Configure wordpress_sites
and vault
Trellis uses ansible-vault to securely store passwords.
Please make sure the following files are up to par:
group_vars/production/wordpress_sites.yml
group_vars/production/vault.yml
Make sure the vault_users password is set to the admin_userβs sudo password.
4. Provision with Trellis
- Update IP address to point to the right server in
trellis/hosts/[environment]
- Run these commands from the trellis root folder. (Note: Windows users run this from the VM)
- Exit the server (
exit
)
5. Deploy with Trellis
Requirements:
-
GitLab account with SSH access
-
On Mac:
- Deploy website:
This leaves you with a provisioned server. πͺ
6. Install WordPress
Visit the domain and complete the WordPress installation.
Optionally you can use WP DB Migrate Pro or WP CLI to migrate the database and media files from your test environment to production.