# Ubuntu 16.04 support

**URL:** <https://forum.mattermost.com/t/ubuntu-16-04-support/2406>\
**Category:** Troubleshooting\
**Created:** [October 24, 2016, 4:04pm UTC](https://forum.mattermost.com/t/ubuntu-16-04-support/2406 "2016-10-24T16:04:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![it33](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/it33/32/3_2.png) [@it33](https://forum.mattermost.com/u/it33)\
**Post date:** [October 24, 2016, 4:04pm UTC](https://forum.mattermost.com/t/ubuntu-16-04-support/2406/1 "2016-10-24T16:04:57Z")

</div>

There’s interest in Ubuntu 16.04 support, along with someone to help test (thanks @amokleben!).

Starting a thread to discuss the differences between Ubuntu 14.04 and 16.04, steps are:

1. Document differences in setup
2. Have community help either drafting a community 16.04 guide or (depending on differences) updating 14.04 guide to support both
3. Consider naming new guides “official” for 16.04 support (needs to be discussed internally, tested, automation setup, etc. May take some time, but community help with initial steps gets us going a lot faster)

 ![](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/1X/5e8f15849d7159d033169fea5dfc6c3bbf9b0d64.jpg)

---

<div class="post-metadata">

**Author:** ![amokleben](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@amokleben](https://forum.mattermost.com/u/amokleben)\
**Post date:** [October 24, 2016, 7:18pm UTC](https://forum.mattermost.com/t/ubuntu-16-04-support/2406/2 "2016-10-24T19:18:35Z")

</div>

Hi,

thanks for the kind introduction.

I set up mattermost on Ubuntu 16.04.1 following the guide for an installation under Ubuntu 14.04.

# Differences

## General setup

My setup was done running all services on one machine. Therefore I did not specify an IP for the server but used `localhost` or `127.0.0.1` (if an IP was required) instead.

I installed the latest release - 3.4.0.

## apt instead of apt-get

One small difference is that I used `apt` instead of `apt-get` which is more a personal liking instead of a requirement.

Commands now are i.e. `apt install nginx` instead of `apt-get install nginx`.

apt-get still works like it used to.

## Postgres

Postgres on Ubuntu 16.04 is 9.5 and therefore the paths to the configs are:

- `/etc/postgresql/9.5/main/postgresql.conf`
- `/etc/postgresql/9.5/main/pg_hba.conf`

The configs for multi-server setup seem to still apply but I did not test this.

## Init-System

Ubuntu 16.04 makes use of systemd. Therefore we need a unitfile that works.  
I used the unit found at [https://gist.github.com/misje/3f1bfe8dffd060994605](https://gist.github.com/misje/3f1bfe8dffd060994605) as a template and ended up with the following:

> [Unit]  
> Description=Mattermost  
> After=network.target  
> After=postgresql.service  
> Requires=postgresql.service

> [Service]  
> Type=simple  
> ExecStart=/home/mattermost/mattermost/bin/platform  
> Restart=always  
> RestartSec=10  
> WorkingDirectory=/home/mattermost/mattermost  
> User=mattermost  
> Group=mattermost

> [Install]  
> WantedBy=multi-user.target

This has to be saved at `/lib/systemd/system/mattermost.service` with root-rights.  
To make systemd read in the file we issue `systemctl daemon-reload`.  
If everything works we see some output from `systemctl status mattermost.service` that looks like this:

> ● mattermost.service - Mattermost  
> Loaded: loaded (/lib/systemd/system/mattermost.service; disabled; vendor pres  
> Active: inactive (dead)

We see the service was loaded but is inactive.  
We can now activate the service (so it will be started automatically after a reboot): `systemctl enable mattermost.service`

We can now start the service via `systemctl start mattermost.service`.  
If we now issue `systemctl status mattermost.service` the service should be `Active (running)`.  
Also the output from `curl http://localhost:8065` should contain `<title>Mattermost</title>`.

For any maintenance we can use systemctl:

- `systemctl stop mattermost.service`
- `systemctl restart mattermost.service`

## nginx

Everything works as displayed. For full use of systemd we can make use of `systemctl` again for managing the service:

- `sudo systemctl stop nginx.service`
- `sudo systemctl start nginx.service`
- `sudo systemctl restart nginx.service`

For now I did not test setting up SSL for nginx.

# Conclusion

So far the only greater change seems to be using systemd instead of Upstart.  
Other than that I did not find any roadblocks and was able to set up an instance that I could create teams on and chat with myself (how intriguing ;)).

---

<div class="post-metadata">

**Author:** ![eric](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/eric/32/242_2.png) [@eric](https://forum.mattermost.com/u/eric)\
**Post date:** [October 26, 2016, 3:56pm UTC](https://forum.mattermost.com/t/ubuntu-16-04-support/2406/3 "2016-10-26T15:56:24Z")

</div>

Hi @amokleben, this is awesome, much appreciated! Based on these differences would you recommend a separate doc for Ubuntu 16.04 or modifying the [14.04 guide](https://github.com/mattermost/docs/blob/master/source/install/prod-ubuntu.rst) with a section to add 16.04 support?

---

<div class="post-metadata">

**Author:** ![amokleben](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@amokleben](https://forum.mattermost.com/u/amokleben)\
**Post date:** [October 27, 2016, 12:36pm UTC](https://forum.mattermost.com/t/ubuntu-16-04-support/2406/4 "2016-10-27T12:36:14Z")

</div>

Hi @eric,

since the only real difference is the init system I’d like to go with one guide for both Ubuntu LTS versions.

For that I’d like to rewrite the daemon management-commands to use the general `service`-command as this works with Upstart and systemd.

I’ll probably will find some time next week to create a branch from [https://github.com/mattermost/docs](https://github.com/mattermost/docs) to work on this. If someone else starts working on this before please let me know so we can coordinate us.

---

<div class="post-metadata">

**Author:** ![jouent](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@jouent](https://forum.mattermost.com/u/jouent)\
**Post date:** [October 30, 2016, 10:51pm UTC](https://forum.mattermost.com/t/ubuntu-16-04-support/2406/5 "2016-10-30T22:51:34Z")

</div>

Thanks so much @amokleben for adding the differences.

I want to share my experience using 14.04 instructions on 16.04. I was able to follow the 14.04 instructions until I got to the Upstart section. Since 16.04 doesn’t have Upstart, I installed it. At first it wasn’t working. When I typed sudo start mattermost, it gave the following error:

start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused

I had to properly install Upstart (which I found by searching for this error message on google). After this change, things seemed to work properly afterwards.

But your instructions sound like they are better.

---

<div class="post-metadata">

**Author:** ![amokleben](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@amokleben](https://forum.mattermost.com/u/amokleben)\
**Post date:** [October 31, 2016, 12:01pm UTC](https://forum.mattermost.com/t/ubuntu-16-04-support/2406/7 "2016-10-31T12:01:57Z")

</div>

I think the one big reason to avoid Upstart is that it is not maintained by Ubuntu anymore because nearly everyone switched to systemd. There may be dragons in Upstart 😉  
Also this is a huge plus for mainiting software in terms of supporting different distributions because, well, everyone uses the same system.
