Set up your Plone deployment server – Plone deployment

Set up your Plone deployment server#

Your Plone project's generated code base includes a /devops/ansible folder, equipped with tools for provisioning and setting up a basic server installation. We'll utilize Ansible for automation, Docker for containerization, and Docker Swarm for enhanced scalability and availability.

Configure the environment#

Create a new .env file by copying the content from the existing .env_dist file:

cp .env_dist .env

Customize the .env file to match your specific deployment environment. Here's an example configuration:

DEPLOY_ENV=prod
DEPLOY_HOST=ploneconf2025-<your-github-username>.tangrama.com.br
DEPLOY_PORT=22
DEPLOY_USER=plone
DOCKER_CONFIG=.docker
STACK_NAME=ploneconf2025-<your-github-username>-tangrama-com-br

Note

The .env file is listed in .gitignore to prevent pushing environment-specific configurations to the repository.

Install Ansible#

Run the following command to create a Python 3 virtual environment and install Ansible with its dependencies:

make install

Configure the inventory#

Update the devops/ansible/inventory/hosts.yml file with the appropriate server details:

---
cluster:
  hosts:
    ploneconf2025-<your-github-username>.tangrama.com.br:
      ansible_user: root
      ansible_host: ploneconf2025-<your-github-username>.tangrama.com.br
      host: ploneconf2025-<your-github-username>
      hostname: ploneconf2025-<your-github-username>.tangrama.com.br
      swarm_node:
        labels:
          type: manager
          env: production

Initiate server setup#

With the correct information in devops/ansible/inventory/hosts.yml, test the connection to the server with:

uv run ansible-playbook playbooks/_connect.yml

And then, if the connection is successful, initiate the remote server setup by running:

uv run ansible-playbook playbooks/setup.yml

This command executes the Ansible playbook devops/playbooks/setup.yml performing tasks like installing base packages, creating a user, setting up SSH, and initializing Docker Swarm on the remote server:

Verify remote server access#

You should now be able to SSH into the remote server as both root and plone users:

ssh root@ploneconf2025-<your-github-username>.tangrama.com.br
ssh plone@ploneconf2025-<your-github-username>.tangrama.com.br

Review#

By now you've now successfully set up a Plone deployment server using Ansible for automated provisioning, Docker for containerization, and Docker Swarm for scalability and availability.

The next step is to deploy your project to this server.