Synology DSM6+ - Xibo Docker 1.8+ Installation

First let me say that this is a work in progress. Alex has been very helpful in providing feed back for this walk though. Please keep in mind that there are many different situations when it comes to the final part of the setup. Please take into account everything you already have running on your DSM6 and the ports they use. It might save you some time and possibly locking yourself out.

If using a current working DSM, please take a backup of everything. Take screen shots of your settings before changing.

Another thing to take into account is if you will be importing data from a previous non-docker installation. If you plan to do so, some settings will need to be gather from the previous installations settings file.

Install Docker from the Synology Package center.

Open Docker App and go to Registry

Click “Settings” and then “Add”

Registry Name: Xibo-Master (or Anything really)
Registry URL: GitHub - xibosignage/xibo-docker: Xibo Docker

Click “Confirm”

Now Search for “xibosignage”

Double Click “xibosignage/xibo-cms” and “xibosignage/xibo-xmr”
This will cause the images to be selected and downloaded.

Now Search for “mysql” (I had trouble with anything but the straight up mysql) and install say 5.6. I would not choose an 8 version.
Double click “mysql” to select and install it.

The various folders to store the cms data and backups need to be created. I went ahead and used the “web” folder you see when you log into DSM and bring up file station. It’s real path on my unit is /volume1/web. I believe this to be a safe place that will not get over written later by DSM or app updates, and it is easily accessible from the DSM web interface.

So I created these folders for the CMS:
/volume1/web/xibo-docker/web/cms/library
/volume1/web/xibo-docker/web/cms/custom
/volume1/web/xibo-docker/web/cms/web/theme/custom
/volume1/web/xibo-docker/web/cms/web/userscripts
/volume1/web/xibo-docker/web/cms/database
/volume1/web/xibo-docker/web/backup

IF YOU ARE UPGRADING READ THIS CAREFULLY: http://xibo.org.uk/manual/en/upgrade.html
Then follow the instructions before continuing

Now back to the Docker App to configure containers

NOTE: If at any point you make a configuration error or want to make a change to either the cms-web or cms-db containers, it is best to delete the containers and start new. (Unless you have previous data. Always backup before anything) Also make sure to remove all files from the database folder before creating a new cms-db container, or you will need to start again.

Select “Image” on the left.

XMR:
Click on “xibosignage/xibo-xmr:release_1.8.X” and click launch.
A wizard will come up. change the name to cms-xmr, checked resource limitation, leave the defaults. Click “Advanced”:

Advanced Settings:
Enable auto-restart

Volume:
N/A

Port Settings:
Local Port: Auto - Container Port:50001 TCP (This is Auto generated by DSM6, not sure why)
Local Port: 9505 - Container Port:9505 TCP

Links:
N/A

Environment:
N/A

Click “OK” at the bottom, then “Next” and “Apply” to save the settings and start the image.

Now cms-db:
Click on the mysql version image you have downloded and click launch.
A wizard will come up. Change the name to cms-db, checked resource limitation, leave the defaults. Click “Advanced”:

Advanced Settings:
Enable auto-restart

Volume:
/volume1/web/xibo-docker/web/cms/database - /var/lib/mysql

Port Settings:
Local Port: Auto - Container Port:3306 TCP (This is Auto generated by DSM6, not sure why)

Links:
N/A

Environment:
MYSQL_ROOT_PASSWORD - ROOTPASSWORD (Make one, If importing from a previous install, then use the password from that setup)
MYSQL_PASSWORD - PASSWORD (Make one, If importing from a previous install, then use the password from that setup)
MYSQL_DATABASE - cms (If importing from a previous install, then use the database name from that setup)
MYSQL_USER - cms (If importing from a previous install, then use the settings from that setup)

Click “OK” at the buttom, then “Next” and “Apply” to save the settings and start the image.

cms-web:
Then Click on “xibosignage/xibo-cms:release_1.8.X” and click launch.

Change the Name to “cms-web”, checked resource limitation, leave the defaults. Click “Advanced”:

Advanced Settings:
Enable auto-restart

Volume:
Add a folder for each of the folders we created earlier except for the myql database. The mount points are in the documentation, so I set mine up as follows:
/volume1/web/xibo-docker/web/cms/library - /var/www/cms/library
/volume1/web/xibo-docker/web/cms/custom - /var/www/cms/custom
/volume1/web/xibo-docker/web/cms/web/theme/custom - /var/www/cms/web/theme/custom
/volume1/web/xibo-docker/web/backup - /var/www/backup
/volume1/web/xibo-docker/web/cms/web/userscripts - /var/www/cms/web/userscripts

Port Settings:
Local Port: 8888 - Container Port:80 TCP

Links:
Container Name: cms-xmr - Alias: 50001
Container Name: cms-db - Alias: mysql

Environment:
Variable: MYSQL_PASSWORD - Value: PASSWORD - (Use the one from above, unless importing - then it needs to match the previous setup)
Variable: MYSQL_DATABASE - Value: cms (unless importing - then it needs to match the previous database name)
Variable: MYSQL_USER - Value: cms (unless importing - then it needs to match the previous database name)
Variable: XMR_HOST - Value: cms-xmr

Click “OK” at the bottom, then “Next” and “Apply” to save the settings and start the image.

NOTE: If at any point you make a configuration error or want to make a change to either the cms-web or cms-db containers, it is best to delete the containers and start new. (Unless you have previous data. Always backup before anything) Also make sure to remove all files from the database folder before creating a new cms-db container, or you will need to start again.

Ok, you should now have 3 running containers. If the CMS container service does not see the mysql database right away it will go to sleep for 300 seconds. You need to wait for the connection to happen. But really there is more stuff to do, so it shouldn’t be a problem.

Since Xibo really wants you to use HTTPS, and you really should, I will show that route of gaining access to the cms from the internet. I will assume that you have a domain pointed to the DSM unit already. (I came from a working 1.8 install running under web station.)

A reverse proxy will need to be configured within DSM. That is found in the “Control Panel” under “Application Portal” and then the “Reverse Proxy” Tab.
Click “Create”, give it a description

Source:
Protocol - HTTPS
Hostname - YOURDOMAINNAME
Port - 443 (Assuming you don’t already have something on it)

Enabled HSTS, and HTTP/2

Destination:
Protocol - HTTP (The reverse proxy is taking care of the SSL endpoint)
Hostname - localhost (Yes really use that)
PORT - 8888 (we used that earlier on cms-web)

Click “ok”

We now need to allow access through the firewall to port 443(If that is the port you choose.)

Last thing is to apply your cert to the reverse proxy connection.

“Control Panel”, “Security”, “Certificate” tab, and then “Configure” button(my cert was not on the correct setting for me.)

If this is a new setup of course you will need to get your certs installed, but that is a whole different topic and not for this site. Also you should then finish up your configuration at:
https://community.xibo.org.uk/t/xibo-cms-post-installation-setup-guide/522

That should be it. You should now be able to access the cms. Please do suggest changes, and ask questions.

The default login credentials to the CMS Instance are the same for all Xibo docker based installations ie:

Username: Xibo_admin
Password: password
3 Likes

Thanks very much @cslaughter for your hard work on this. I know you said you couldn’t make it work without the MYSQL_ROOT_PASSWORD being set on the web container, but nothing there uses it, and we don’t set it with docker-compose either, so I’m pretty sure that won’t be required. Otherwise it looks like a really useful guide.

Alex,

Thank you for the feed back. I agree that MYSQL_ROOT_PASSWORD should not be needed. And it might be able to be removed after the initial database creation. I just could not get the database container to actually create the database without it. Not sure if it is a strange DSM thing(there are many with DSM6), or what, but if I get some more time I will see about investigating that.

In the mean time if anyone else wants to try Alex’s suggestion on their DSM 6.0 and DSM 6.1 devices that would be great.

It is definitely necessary on the MySQL container (or MYSQL_RANDOM_ROOT_PASSWORD in its place as we use in the docker-compose setup) :slight_smile:

Oh got it, just not needed on the web container. I missed that on your first reply.

First of all BIG THANKS to you two guys. Your my hero - in fact I plan to have 2 frames on my desktop for at least a month, to remind me of that crazy work You are doing to help us DOCKER DUMMYS with Synology - THANKS, A HUNDRED, cslaughter, and alex.

I tried to follow your instruction. I can see that image are running but where do I into the web interface?
when I run the image in docker terminal, it starts up but stops again when connecting to DB creation. I use phpMyAdmin as SQL, when you say MySQL, do you then mean “MySQL” only place I can find that is also on docker regi.
And Docker… well is the one I try to learn:slight_smile:

I still feel like I am in that category of Docker Dummy’s. :grin: But I see much potential with Docker and DSM6. Very easy upgrades, small compact hardware roll outs, ability to do load balancing, easy backup and system transfers, and more.

The web interface should be https://yourdomain.com. I have setup a sub-domain for my installation and a SSL cert to go with it. So mine is something like https://cms.domain.com.

I am not sure I follow on this. Are you saying that the cms-web container on the terminal window starts then stops? I think that is normal when it doesn’t have anything to do. If you are seeing the cms-db container start and stop, I saw that when I did not have the environment variables correct. I would delete your cms-db container, remove everything from the database folder, stop the cms-web container. Then rebuild the cms-db container, then start it. Look at the cmd-db log in docker and see if you see the main database being created. If that looks good and it is staying up, then I would start the cms-web containter. Look at the cms-db log again and see if you see that Xibo configured somethings. If that all looks good, then try to access the cms. If you cannot, please post back with any errors and screen shots of the docker info pages for the cms-db and cms-web containers.

Yes in the docker registry if you search for mysql, the first result should be “mysql”. I am currently using 5.7.18 that I selected when downloading the image, 5.6 should also work fine.

Dear cslaughter

Thanks for your effort to make a guide on how to install xibo on dsm 6.x synology.
I have really tried to install bit by bit from your guide, and it just won’t work.
No matter how I try to install with dozens of combinations it always stops with, docker xibo cms-db can´t connect to mysql.

I have tried to just install mysql 5.6 with no description in volume, port settings, links and environment. Mysql just restart in a constant loop. I have also tried to install mysql on best practice, then mysql runs as a standalone app inside docker whiteout any connection with xibo-cms.

I usually get the log message “ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (0)” or “cannot find Mysql host” I really want this to work, but no matter how I try it seems to stuck with the connection with mysql inside docker. Outside port 3306 is taken by Maria db and phpMyAdmin. I also tried to uninstall both with same result other than I can choose port 3306 outside port. So, what am I doing wrong.

The issue with environment variable “MYSQL_ROOT_PASSWORD” that was not needed told me that mysql is installed in docker but you write in your guide that” now you should see 3 containers” and that puzzles me because cms-xmr, cms-db and cms-web is 3, but what about mysql?

Is it possible for you to specify, how you should install mysql inside docker?

I hope you can help me, it would mean a lot.
Thanks, in advanced

Herboras,

Is the MySQL database docker container.

I also have MariaDB running and did not need to configure special ports.

Are you completely removing the “cms-db” between each failed attempt at setting this up? If not, then that will causing problems and the setup will not get completed. When the “cms-db” runs the first time, it creates the database and user access based on the givin variables. If they are not correct, the only way to fix that is to destroy the “cms-db” docker container and then recreate it. It took me a while to get it correct. I think the biggest mistake that can be made when following the guide, is starting the “cms-db” before all the variables configured.

Can you post a screen shot of how you configured the variables for the cms-db container? Please mask username, password, and anything else you do not want people to have.

SOLVED
OMG - the magic word was "cms-db IS the mysql"
Because in your guide you wrote:
Now cms-db
_Click on “xibosignage/xibo-cms-release_1.8.X” and click launch

It should be “click on mysql version image you have downloded” instead…

everything is runing first time.
THANKS A LOT "NOT in a sarcastic manner I am truly thrilled"
why oh why dident I listen to myself the first minute i was reading your guide "I was wondering why do I have to launce the xibo-cms-release twice? well… they have there reason. :confused:

Heboras

Heboras,

Glad to hear you were able to get it working!

Thank you for the feed back and catching my mistake. I have made the change to the guide.

Thanks again. :grinning:

Hello, cslaughter,

thank you for your very useful guide. I’m trying to get this setup running using

  • DiskStation DS412+
  • DSM 6.1.2-15132
  • Docker 1.11.2-0329
  • mySQL 5.6.36
  • Xibo Signage 1.8.1

However, I experience problems starting up the mySQL-database:

Initializing database
2017-06-27 09:17:24 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-06-27 09:17:24 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2017-06-27 09:17:24 0 [Note] /usr/sbin/mysqld (mysqld 5.6.36) starting as process 35 …
2017-06-27 09:17:24 35 [Warning] Can’t create test file /var/lib/mysql/cms-db.lower-test
2017-06-27 09:17:24 35 [Warning] Can’t create test file /var/lib/mysql/cms-db.lower-test
a/usr/sbin/mysqld: Can’t change dir to ‘/var/lib/mysql/’ (Errcode: 13 - Permission denied)
2017-06-27 09:17:24 35 [ERROR] Aborting
2017-06-27 09:17:24 35 [Note] Binlog end
2017-06-27 09:17:24 35 [Note] /usr/sbin/mysqld: Shutdown complete

Any ideas on this? Any hint would be helpful, as I’m totally new to docker… The directories certainly exist (I named it ‘database’ instead of ‘datbase’ as in your guide - a typo?)

Thanks in advance,
tajbender

tajbender,

The “datbase” is a typo. Thank you for bring that to my attention. I would fix it, but for some reason I cannot edit the post anymore (@Peter ??)

Are you completely removing the “cms-db” between each failed attempt at setting this up? If not, then that will cause problems and the setup will not get completed. When the “cms-db” runs the first time, it creates the database and user access based on the given variables. If they are not correct, the only way to fix that is to destroy the “cms-db” docker container and then recreate it. It took me a while to get it correct. I think the biggest mistake that can be made when following the guide, is starting the “cms-db” before all the variables configured.

EDIT:
I looked at that error a bit closer and it looks like a permissions issue

2017-06-27 09:17:24 35 [Warning] Can’t create test file /var/lib/mysql/cms-db.lower-test
2017-06-27 09:17:24 35 [Warning] Can’t create test file /var/lib/mysql/cms-db.lower-test
a/usr/sbin/mysqld: Can’t change dir to ‘/var/lib/mysql/’ (Errcode: 13 - Permission denied)

When you created the folders on the Synology box, does the SYSTEM have full control permissions? Mine show my user, and for some reason, that http has read/write access. Not sure that should be. When I get some free time…(not sure when that would be) I might try shutting everything down, remove the http and try firing it backup.

@cslaughter I’m not sure why you can’t edit it to be honest :confused:

In any case I’ve corrected this typo (it occurred 2 times in the original post I believe).

cslaughter,

I’ve set up the whole DSM from the scratch, now it works!!! Thank you very, very much for your efforts!

The problem, I assume, was that I had a native instance of MariaDB installed prior on the DSM. It was disabled, but its configuration should have caused the trouble… :disappointed_relieved:

However, thank you very much! :kissing_smiling_eyes:

Regards, tajbender

A note on updating your 1.8.X installation

The way to update the Containers on the Synology is not like the upgrade instructions. (I was hoping for something easier, if someone can see a better way, please let me know)

Here is the short version of what to do. I will expand on it, I am sure at some point.

First note that you will need to make sure you have a working backup, as suggested in the upgrade instructions. If you followed my guide, you should look here for the files: /volume1/web/xibo-docker/web/backup.

Also note that DSM6 has some quarks. One of them is that even if you disable a container, you cannot setup a new container with the same ports. So what this means is that when you are ready to shutdown the old container and bring up the new one, we need to change, or delete the old container first.(I prefer change as a fail-safe)

You will want to go to the Docker registry and downloadxibosingage/xibo-cms:latest.

One that is download you will need to configure it using all of the same settings as the previous container. The guide above has them, IF you used those to begin with. Remember that you will need to shutdown the previous CMS container, and then change the ports on it’s settings, before configuring the new container. I also recommend changing the name to xxxx.old and then name the new container what the old one was named.

Once that is done, fire it up and wait a few mins before trying to access the portal. Then it will probably have an upgrade wizard, click next, or what not. It should succeed. Now you should be up to date.

Hello,

is there anyone who can make a youtube Install-Video with the newest xibo version on Synology??
I think thats very difficult for an beginner!

Pictures and video say more than 1000 words.

best regards

Kussel

Kusselin,

Unfortunitaly I do not have the time, or a free Synology box at the moment to do a video. And honestly have never done a video.

I would be willing to answer questions, but I would suggest starting another thread.

hello,

I followed precisely the tutorial and everything went smoothly.
The problem is that when I connect to the xibo web interface, it asks me for a username and password that is not specified in your procedure.
Can you tell us the credentials or tell me how I can create them.

Thank’s

While I don’t have a synology box to go through the guide, I’d assume the default CMS login credentials will be the same as usual in Xibo docker installations ie

Username: Xibo_admin
Password: password