Installing Alfresco Using Docker & Docker Compose on Ubuntu

Alfresco is an open-source Enterprise Content Management (ECM) platform that provides organizations with a robust solution for managing documents, workflows, and collaboration. In this guide, we'll demonstrate how to install Alfresco using Docker and Docker Compose on an Ubuntu system.

Step 1: Install Docker

1. Update the package index:
sudo apt update
2. Install prerequisites for Docker:
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
3. Add the Docker GPG key and repository:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
4. Install Docker:
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
5. Verify Docker installation:
docker --version

Step 2: Install Docker Compose

1. Download Docker Compose:
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
2. Set executable permissions:
sudo chmod +x /usr/local/bin/docker-compose
3. Verify Docker Compose installation:
docker-compose --version

Step 3: Set Up Alfresco User and Directory Structure

1. Create a new user for running Alfresco:
sudo adduser --system --shell /bin/bash --group --home /home/alfresco alfresco
2. Create the directory hierarchy for Alfresco:
sudo mkdir -p /vm/alfresco
sudo chown -R alfresco:alfresco /vm/alfresco
3. Switch to the Alfresco user:
sudo -u alfresco -i

Step 4: Log In to the Private Docker Repository

1. Log in to the private repository:
docker login https://quay.io
2. Provide your credentials when prompted.

Verify the login was successful:

docker info | grep "Registry"

Step 5: Obtain the Docker Compose File

The Docker Compose file for Alfresco must be requested through Alfresco Support. Contact their team to get the appropriate file for your setup. Do not use generic Docker Compose files for production environments.


Step 6: Start Alfresco with Docker Compose

Place the Docker Compose file in the desired directory:

cd /vm/alfresco
1. Start the services using the custom file name:
docker-compose -f docker-compose-001.yml up -d
2. Verify the containers are running:
docker ps

3. Access Alfresco in your browser: Open your browser and navigate to

http://:8080.

Log in to Alfresco:

Username: admin

Password: admin

Step 7: Manage Alfresco (Optional)

  • To stop the services:
    docker-compose -f docker-compose-001.yml down
  • To view logs:
    docker-compose -f docker-compose-001.yml logs -f
  • To restart the services:
    docker-compose -f docker-compose-001.yml restart -d

Accessing Alfresco Components

Once the services are up and running, you can access the following components:

  1. Alfresco Share (Collaboration UI):

  2. Alfresco Repository API:
    http://swcm-10-qa-alf-001-s-001:8080/alfresco
  3. Solr (Search Services):
    http://swcm-10-qa-alf-001-s-001:8083
    To access Solr with the shared secret:
    • Use a tool like curl:
      curl -H "X-Alfresco-Secret: secret" http://swcm-10-qa-alf-001-s-001:8083/solr
    • Or install a browser extension like "ModHeader" for Firefox to add the header:
      • Header Key: X-Alfresco-Secret
      • Header Value: secret
    • Then access Solr in your browser at
      http://swcm-10-qa-alf-001-s-001:8083/solr.
  4. Digital Workspace:
    http://swcm-10-qa-alf-001-s-001:8080/workspace
  5. ActiveMQ:
    http://swcm-10-qa-alf-001-s-001:8161
  6. Control Center
    http://swcm-10-qa-alf-001-s-001:8080/control-center
  7. Transform Engine:
    http://swcm-10-qa-alf-001-s-001:8090/live
  8. Transform Router:
    http://swcm-10-qa-alf-001-s-001:8095/actuator/health
  9. Shared File Store:
    http://swcm-10-qa-alf-001-s-001:8099/live

Issues Faced and Solutions

Issue: CSRF Error When Accessing Alfresco Share

Description: When accessing http://:8080/share, a 500 error was encountered with the following log:

javax.servlet.ServletException: Possible CSRF attack noted when asserting referer header 'http://:8080/share/page/'. Request: POST /share/page/dologin, FAILED TEST: Assert referer POST /share/page/dologin :: referer: 'http://:8080/share/page/' vs server & context: http:/// (string) or http://localhost:8080/share/.* (regexp)

Solution:Update the CSRF settings in the docker-compose file to match the actual hostname being used.

1. Locate the share service configuration in the Docker Compose file.

Update the CSRF_FILTER_ORIGIN and CSRF_FILTER_REFERER environment variables as follows:

CSRF_FILTER_ORIGIN: http://swcm-10-qa-alf-001-s-001:8080

2. CSRF_FILTER_REFERER: http://swcm-10-qa-alf-001-s-001:8080/share/.*

Save the changes and restart the services:
docker-compose -f docker-compose-001.yml down

3. docker-compose -f docker-compose-001.yml up -d

Verify that the error is resolved by accessing
http://swcm-10-qa-alf-001-s-001:8080/share again.


Conclusion

You have successfully installed Alfresco using Docker and Docker Compose on Ubuntu.

Post a comment