I did the same except federated and it's pretty easy if you have some experience with Ansible and Docker. This repo has a great Ansible playbook that will set up the whole thing for you on whatever VM or VPS you point it at:
https://github.com/spantaleev/matrix-docker-ansible-deploy/b...