How to Set Up a Docker Container (Beginner)

Welcome to this guide on setting up the Sendent for Outlook Docker container on a Linux system. We'll be using Ubuntu 24 (LTS) for this guide.

As a prerequisite, you need to set up a valid DNS record that points to your Ubuntu installation. Before starting, add a DNS A-record that directs your custom domain to the public IP of your Ubuntu installation. In this guide, we will use the IP '0.0.0.0' for our Ubuntu installation and the A-record 'outlook.sendent.dev'. 

Installation

1. Update packages

First, we'll begin by updating the dependencies in your Ubuntu installation. Please follow any prompts that appear after running the following two commands. 

apt-get update (fetch latest)

apt-get upgrade (download and install)

Depending on the available updates, some follow-up dialogs might appear. The guide does not cover this.

2. Install NGINX

We use NGINX as the reverse proxy, this will allow the Ubuntu installation to bind itself to the necessary docker port. 

apt-get install nginx

3. Install Docker

With the following command, Docker will be downloaded and automatically installed on the Ubuntu machine.

curl -fsSL https://get.docker.com | sudo sh

4. Setting up Sendent for Outlook

4.1. Create the docker compose file

Mount the ./usr directory.

Create a new directory in usr named sendent-outlook.

Create a new text-file, using nano nano docker-compose.yml. Please replace <YOURDOMAIN> with your actual own domain, with included protocol. For example: <YOURDOMAIN> becomes https://outlook.sendent.dev.

Notice: Some extra environment variables might be applicable. This depends whether the installation is Microsoft Exchange On-Premise or Microsoft 365.

Please see the following article and modify the docker compose file accordingly. 

version: '3.9'
services:
sendent.outlook:
image: rg.nl-ams.scw.cloud/sendent-public/sendent-outlook:latest
platform: linux/amd64
build:
context: .
dockerfile: Dockerfile
restart: on-failure
environment:
- BASE_URL=<YOURDOMAIN>
- FEATURES_CODES_TO_REMOVE=
ports:
- "4300:4300"
volumes:
- ./docker-config:/usr/src/app/outlook-addin/docker-config
networks:
- node_network
 
networks:
node_network:

4.2. Choose features

Depending on the installation, you might want to remove certain features. 

⚠️ Please consider these changes carefully
If you are a Microsoft 365 user, be aware that changing these settings is not instant. Updates are distributed centrally by Microsoft and can take up to 48 hours to take effect on all clients. We also recommend incrementing the <version> element in the manifest file, e.g. if we set 2.5.0, you increment it to 2.5.1 etc.

If you want to experiment with a limited setup first, use side-loading instead, this applies changes immediately and only affects your own client.

For FEATURES_CODES_TO_REMOVE= you can set the following values to remove certain buttons and events in the Outlook add-in:

0 = Remove Activity Tracker
1 = Remove Secure Mail
2 = Remove On-Send event actions
3 = Remove Nextcloud Talk Desktop
4 = Remove Nextcloud Talk Mobile
5 = Remove Nextcloud Files related features (upload files, public sharing)
6 = Remove the automatic email signature*

*Code 6, the automatic email signature, is new in version 3.0.0. It only works with Microsoft 365 and MS_AUTH_TYPE=naa_silent. With any other MS_AUTH_TYPE, the container removes it automatically and prints a notice in its log. Add 6 to hide that notice. An administrator enables the signature in the Sendent app for Nextcloud. Read more in How to use the automatic email signature.

4.3. Allow your Nextcloud server

From version 3.0.0, the container only forwards add-in traffic to the Nextcloud servers in PROXY_ALLOWLIST. Separate several servers with commas. Both examples below set it.

If you leave it out, the container allows only the server in DEFAULT_NEXTCLOUD_URL. If neither is set, the container forwards to any server and warns about this in its log. We do not recommend that in production. Read more in How to configure the proxy allowlist.

4.4. Recommended configuration

For free users we recommend the following: 

BASE_URL=<YOURDOMAIN>
 
FEATURES_CODES_TO_REMOVE=0,1,2,6
 
PROXY_ALLOWLIST=<YOURNEXTCLOUDDOMAIN>

<YOURNEXTCLOUDDOMAIN> should for example be https://nextcloud.sendent.dev.

For licensed users we recommend this:

Warning: we disabled on-send interaction in this example. You can re-enable it later again if you verified the installation works correctly, by simply removing the ‘2’ in FEATURES_CODES_TO_REMOVE and then re-upload your manifest file, if you uploaded the XML file manually. On-send interaction is needed if you want to automate uploading of attachments when the send button is clicked within Outlook.

BASE_URL=<YOURDOMAIN>
 
FEATURES_CODES_TO_REMOVE=2
 
DEFAULT_NEXTCLOUD_URL=<YOURNEXTCLOUDDOMAIN>
 
PROXY_ALLOWLIST=<YOURNEXTCLOUDDOMAIN>

4.5. Start the container

Save and close the file. Ctrl + X, Y and hit Enter.

From the same directory, now do: docker compose up -d. This will download and start the Sendent for Outlook docker container.

5. Configure NGINX

5.1. Configuring Site

After installation, navigate to the following folder:

./etc/nginx/sites-enabled

We will use 'nano' a text-editor to modify the config. If it's not there, we will automatically create it. Replace <YOURDOMAIN> with the domain you reserved for this service. For example: <YOURDOMAIN> could be replaced with outlook.sendent.dev.

nano <YOURDOMAIN>.conf

Copy and paste the following. You can paste it in nano with right mouse click. 

Notice, modify the server_name that it reflects your own domain.

server {
listen 80;
server_name <YOURDOMAIN>;
 
location / {
proxy_pass http://127.0.0.1:4300;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

You can close and save nano by ctrl + x and when asked to save Y and hit enter.

Verify the NGINX config with nginx -t. There should be no errors.

5.2. Modifying default NGINX configuration

Next step is modifying the nginx configuration, so large files can be uploaded.

nano /etc/nginx/nginx.conf

You will notice there's a HTTP element add, the following line there. 

client_max_body_size 250M; (the maximum file size will be 250MB with upload, you can increase this though).

Example client_max_body_size.

You can close and save nano by ctrl + x and when asked to save Y and hit enter.

Verify the NGINX config with nginx -t. There should be no errors.

Now let's reload NGINX by doing systemctl reload nginx.

6. Installing Let's Encrypt.

Within this guide we use the free Let's Encrypt service to enable a safe SSL connection. Let's encrypt will automatically configure our NGINX configuration further. 

apt install certbot python3-certbot-nginx

After installation restart NGINX with systemctl reload nginx

Then we're going to generate the SSL certificates with the following command, notice replace <DOMAIN> with your own.

certbot --nginx -d <DOMAIN>

Example:

certbot --nginx -d outlook.sendent.dev

It will ask to enter your email, to agree with their (Let's Encrypt) Terms and Conditions.

7. Enabling the firewall

NOTE: Please double check if you whitelisted ALL necessary ports. The following section is recommended, but should be double checked on your own installation.

ufw allow 'Nginx Full' (allow port 80 and 443)

ufw allow 'OpenSSH' (allow port 22 ssh)

Warning, if not all the right ports are allowed, you might lose connection to the server or other services may get disrupted. Double check this.

ufw enable (enable firewall)

8. Verify

If all went well, you can now access the manifest file that is hosted on your own server. You can do this for example by navigating in your browser to:

https://<YOURDOMAIN>/manifest.xml

Example:

https://outlook.sendent.dev/manifest.xml

The response should start with: 

Example response.

Updates

In your usr directory, where the docker compose file is located run these commands, to update to the latest version for Sendent for Outlook.

# Pull the latest images
docker compose pull
 
# Stop the running containers
docker compose down
 
# Remove old containers
docker compose rm -f
 
# Start the containers with the updated images
docker compose up -d

Updating from 2.x to 3.0.0 

Before you update:

  • Allow your Nextcloud servers. The container now only forwards add-in traffic to the servers in PROXY_ALLOWLIST, or to the DEFAULT_NEXTCLOUD_URL server if that is not set. Add every Nextcloud server your users sign in to. Otherwise their sign-in fails with "Forbidden: Target URL is not in the allowlist". See How to configure the proxy allowlist.

  • Remove quotes. If the value of DEFAULT_NEXTCLOUD_URL in docker-compose.yml has quotes around it, remove them.

After you update:

  • Deploy the new manifest. Version 3.0.0 comes with a new manifest. It renames the add-in to Nextcloud for Outlook and adds the automatic email signature. Your current manifest keeps working, but users only get the new name and the signature after you deploy the new one. If you uploaded the manifest XML manually, download it again from https://<YOURDOMAIN>/manifest.xml and upload it. Its version is already 3.0.0, so you do not need to change the <Version> element. Microsoft 365 can take up to 48 hours to roll it out.


Was this article helpful?