Running Element Web - Browser Based Matrix/Synapse Client - in Docker 🌱

What is Element?

Element (formerly known as Vector and Riot) is a Matrix web client built using the Matrix React SDK. -https://github.com/vector-im/element-web

Installing Docker

  1. Log into the Linux host and run the following commands in a terminal window
    # install prerequisites
    sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y
    # add docker gpg key
    curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -
    # add docker software repository
    sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"
    # install docker
    sudo apt install docker-ce docker-compose containerd.io -y
    # enable and start docker service
    sudo systemctl enable docker && sudo systemctl start docker
    # add the current user to the docker group
    sudo usermod -aG docker $USER
    # reauthenticate for the new group membership to take effect
    su - $USER

Running Element Web

  1. Continue with the following commands in a terminal window
    # create working directories
    mkdir ~/docker/element -p
    # download example config
    wget -O ~/docker/element/config.json https://raw.githubusercontent.com/vector-im/element-web/develop/config.sample.json
    # edit config.json if needed
    nano ~/docker/element/config.json
    # run the element web container
    docker run --name elementweb -d -v ~/docker/element/config.json:/app/config.json -p 8080:80 --restart unless-stopped vectorim/element-web
  2. Open a web browser and navigate to http://DNSorIP:8080

Documentation: https://hub.docker.com/r/vectorim/element-web