Setup your self hosted, open source, Matrix chat server for fully private and encrypted messaging.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign [Music] Source Advocate and I'm back with another video and today we're going to go over Matrix and we're going to set up the server using dendrite so if you've watched my past video we set it up using synapse I went back through that and I was trying to get everything set up and running I just kept running into issues and issues and issues and one of the things that I found was a lot of people said that synapses are really heavy server and you need more resource to run it so I started looking around I found dendrite which is another Matrix project which is uh basically built off of synapse but they're working it out in go language so that's interesting and it's supposed to be a little bit lighter weight for usage so again us being self-hosters and people who want to maybe run something for our family or our small business things like that I think this is going to be a really great option the best news is we're going to go through not just setting up the server itself but we're going to make sure that we've got our admin user set up and our other users set up and we're going to set up the complete Federation system for it so that you can actually get connected to other Matrix servers if you want to it's completely optional to do that but on my last video a lot of people are asking me hey how do I set up the Federation and I never really got that to work either so I'll go through how I did it this time and got it functioning and everything is up and running so I wanted to go through Matrix with you guys today and just show you what you can do with it it's really great and then in a follow-up video we're going to set up our own turn server so if you want to use video and audio chat with anything like Matrix but with other systems as well with next talk that's on next Cloud so they have next talk which is a really cool way to communicate if you have a next cloud system already set up but again you need to turn server a lot of times when you're behind Nat which most of us are if you're if you're running on a home system you're probably behind a Nat system which means you've got a firewall you've got an incoming thing from your ISP and then you're inside of a private Network that uses Network address translation to get information back and forth between you and the internet so a lot of times you need a turn server to make everything function really well with video and audio chat so we want to make sure we get that set up as well but we're going to do that in the future on the next video so that you'll have that part set as well so yeah we've got a whole lot of really cool stuff coming and we're going to start with Matrix and the dendrite server right after this I want to say thank you to all of my subscriber and all of my patrons over at patreon seriously you guys make this so worth it for me to do these videos every week I really truly enjoy it and I just can't say thank you enough if you're enjoying these videos subscribe let YouTube know that I'm doing a good job by subscribing to the channel plus you'll get notified when I have new videos coming out and finally if you're enjoying what I'm doing give it a like just click on that thumbs up and that way YouTube knows that you like it and they'll pass it along to other people that might enjoy my content as well I really appreciate it thank you again let's get started in order to get our metric server up and running we're going to need a few things and you're going to want to have these things set up and ready so the first thing is I'm going to set this up on a lxc container inside of proxmox now you can use a regular virtual machine you can use a lxd container it is completely up to you how you do this but it needs to be able to run Docker because we're going to use the docker version of the dendrite server I think this makes it much simpler to get it set up and running for those of you that don't like Docker however there are other images out there and available so if you go I'll have these links in the show notes in the description for you guys so you can jump straight to these things but here's the regular dendrite installation they've got all your requirements they've got your get started they've got all the different instructions for you to do that we're not going to go through this one today this is really up to you if you want to do this route we're going to do the docker install the docker install is pretty straightforward I'm going to walk you through it it's going to take us maybe 15-20 minutes to do it I'll try to explain as much as I can like always so that you'll really understand what's going on if you're somebody who's much more technical you may not need me to explain this I'd love you to watch the video anyways just to make sure that if you have questions hopefully I've answered at some point in the video but if not always drop me a comment I'll do my best to answer questions now I'm I'm not the person who makes this project I'm just letting you know about this project so that you can go out there and try it so if you have two detailed questions I might get you to come over here to the GitHub and actually post an issue or post a question that way or jump into one of their Matrix rooms to post a question using matrix.org things like that so there are other options to get answers so we're going to use it I'm going to use an lxc container and install Docker on it and I'll walk you through that process the thing you're going to want to have is a proxy a reverse proxy so I use nginx proxy manager it allows me to set up different reverse proxies so that I have these different URLs that I can get back to inside of my home network or a business Network or however you're setting this up so I'm going to use nginx proxy manager you can use any reverse proxy that you want to I just happen to like this one it's fairly easy for me to use and pretty easy for me to show you how to set it up as well the last thing you're going to need is a domain name that you own so a domain name that you own means maybe you own the domain that's called mybestchat.org okay if you own mybestchat.org you've got it registered with a registrar and inside of that registrar's tools there should be DNS settings you need to be able to set an a record in your DNS for that registrar for your domain and we're going to create a subdomain so we're going to call this and we'll just say we call it chat dot your best domain.org you want to build a set an a record that points this to your public IP address now if you have a public IP address that changes all the time like very frequently you might want to set up something like dot DNS where you can get a different address that updates whenever your IP updates so that it keeps you connected but you do need to have something where you can set up this a record first make sure this a record just says hey take this name and point it to my public IP address that's all it's telling it to do that's that's a DNS record you have to set up the next thing we're going to do is going to set up our server we're going to get things up and running and installed and the last bit we'll do is set up our reverse proxy and then we'll set up a couple of things to make sure that we can actually get Federation going and for that you're going to be need to be able to port forward a specific Port through your firewall from the outside Internet to the inside of your network to the machine that's running your Matrix server once it's up and running and then finally we'll go through setting up some accounts real quick and we'll talk briefly about the different clients that are available for Matrix so this will probably be about a 25-30 minute video I think it's going to be great so let's get started all right let's start from the very beginning so for those of you who already have a server set up you already have Docker and everything installed you can feel free to skip ahead I'll have time stamps down here so you can just kind of figure out where you want to start and where you want to go to you don't have to watch all the way through these parts if you already know how to do it but for those who don't we're going to create an lxc container in proxmox now you can just use a virtual machine you can use an lxc container you can use an lxd container it's up to you but you need some kind of Base system you can use just a machine you have off to the side like a computer that you're going to put Ubuntu on if that's what you want or whatever version of Linux you want but you need to be able to get Docker installed on it so what I'm going to do is I'm going to create an lxc container and I'm just going to right click and I'm just going to say create CT I'm going to call this thing chat and I'm going to give it a password so I can log in as the admin to it always give it a nice strong password we're just going to click next now from the images for my CTS I'm going to pick my Ubuntu 2204 now as this goes down the road you may want to pick a newer version of Ubuntu I always use long term support versions for servers but you if it's 2024 and 2404 is out for a couple of months you might want to use that one next I'm going to do is pick where do we want to store this so in this case I want to give this a good amount of space so it doesn't have to be lightning fast for this to work either so this one I've got 12 terabytes in this large pool so I'm just going to choose that one and I'm going to give it a 500 gigabytes there we go 500 gigabytes and don't need to check any of those items on the CPU in fact I'll undo that I'm going to give it two CPU cores now again depending on how many cores you have available may depend on how many you want to give it but if you have a lot you could give it four you could give eight it just depends on how much you think this is going to be used it's going to be used by hundreds and and thousands of people definitely give it many more cores memory I'm going to give this eight gigs so that's 80 96 and swap same thing 8096 on the network first I'm going to let it do DHCP just so it grabs an address and then I'll go back and set it static for that address on my network so for now just take DHCP on your ipv4 DNS nothing to mess with and then custom or confirm we're just going to confirm it and hit go it's going to create that real quick it should only take a couple of minutes I mean a couple of seconds there it's done and we're going to wait for it to show up over here and there it is and now we're just going to click right click on it click Start to get it going I'll click on it and we're going to click on the console so I'm gonna do a couple of things here in the console I'll try to remember to zoom in on this and I'm going to log in with my root user so the first thing we need to do is update everything so we'll do apt update and then apt upgrade Dash y so with an ampersand two ampersands between them that tells I do both commands so if you don't prefer to sit here and watch an update happen I'm just going to jump ahead in time a little bit all right now that that's complete we need to create a non-root user so I'm going to do add user and this is only for Ubuntu Debian systems if you're using Susa or Fedora you're going to do user ad just reverse those two words but they're pushed together I'm going to put in the username I want I'm going to hit enter I'm going to give this user a password and again and then it's going to ask you some questions you can fill them out or leave them blank like I am then hit Y to confirm and it's done now we need to make our user a non-root but pseudo user so we're going to say user mod hyphen little a capital G which means modify this user and add them to the group sudo and then the username that you want and you can put a list of usernames if there's more than one but in this case it's just me and now I'm part of the pseudo group so I'm just going to do a reboot of the server here the nice thing about lxc containers is they reboot really fast I'm going to log in one more time as root and I'm going to get the IP address of this thing so we do IP Dash BR space Dash C A like this so it's ipbr-c space a and then we've got the IP address which is 73 so I'm going to take that I'm going to go over here to my networking here and I'm going to click on this I'm going to change this to static I'm going to put that in AS 192.168.10.73 Slash 24. and then my Gateway is 192.168.10.1 I'm just going to click on OK and I'm going to go back to the console and I'm just going to say reboot one more time just so it'll pick that up and pull it into the static address this time and now I'm actually going to open up my regular terminal here so I'm going to SSH into that machine as my non-root user and I'm going to clear that out so I've already updated and upgraded every package on the machine I've created my non-root user I've given my non-user pseudo privileges I've set a static IP address on my network and now I'm logged in as that user so the next thing we need to do is make a couple of folders so the easiest way to do is this do mkdir-p Ocker and then slash Matrix so what this says is check and see if the docker directory exists and if it does use it if not create it then check and see if the Matrix folder exists inside of that folder and if it does use it if not create it so it's going to do all that in one one step which is great we're going to move into that folder with CD Docker Matrix all right we've created this folder structure now we need to install Docker and Docker compose so we're just going to go back to our home directory here and we're going to use this W get command here which is W get Dash o which means the output file should be named install Dash docker.sh and it's going to pull it down from our repository out there on gitlab and there we go and we're going to change the permissions on that file to chmod plus X install docker.sh and then we're just going to run it with DOT slash install docker.sh so this is going to run a script that's going to help us pull down Docker CE Docker compose and nginx proxy manager if you need it I already have it installed on my network but if you don't then and you need a reverse proxy then this is one that you can install so I'll show you how it works so it's going to come up and tell you what it finds so it sees this is a Ubuntu 2204.3 LTS jammy so if we look here 2204 is number four so I'm just going to hit 4. it's going to ask me for my super user password and then I'm gonna say yes I want Docker CE yes I want Docker compose I don't need internet Xbox manager but if you do you would type y I'm going to hit n and then I'm going to hit n for the rest of these options here because I don't need them and it's going to go through and try to update the packages so I run the package updates ahead of time just to save time and it's going to install our prerequisite packages that we need for Docker and Docker compose and that's going to install Docker CE tells us what version of Docker CE we got now it's going to install Docker compose after it it sets our user as a user in the docker group and it's going to install Docker compose tells us the version and it sets up a default Network for us that's not like the regular default Docker Network so we're pretty much set everything should be here and ready but the one thing we need to do is reboot one more time so that'll reboot the system and once it reboots we can log right back in only takes about 10 or 15 seconds for an lxc container to reboot so it's really nice there we go and now that we're in we should have Docker and we do Docker PS to test it out and you can see there's nothing running but we do have the ability to run Docker PS without using the sudo command every time so now we're going to just log go back into the docker slash Matrix folder with CD Docker Matrix and we're going to do a w get to actually go and pull down the docker compose file that we need and if we do LS we'll see dockercompose.yaml is down and if we do a nano of Docker compose.yaml so that's our text editor we'll see it open up and everything is already here and kind of set now there's a few things we want to change about the way that this is set up so first of all these volumes I like to do dot slash so that they all get put inside of the parent folder which is Docker Matrix so that'll create a folder called dendrite postgres data and it's going to be mapped to the container that slash VAR slash live postgres SQL data that just means all of our data is going to be stored inside of this Docker folder where we're putting everything so here where they've got this password we want to change this to something long and strong and you want to make sure it's a really good password but just change it to anything you want it should just be a bunch of capital lowercase letters numbers you know symbols things like that just keep it long and Powerful so we'll just go with something like that maybe not the period I don't know what that'll do to a postgres database but there we go we've got a long password that's great you leave the username in the database name the same we're going to move on down past this because it's just our health check nothing to change there and then right here we've got this part that says it's the monolith so this is going to be the part that actually runs the Matrix server and it's going to run on 8008 supports 8008 and 84.48 if you need for some reason to change this port on the left side that's the port on the host where it's going to be running in my case I don't but if you need to you can just change it to a port that's not one that's determined to be pre-used by the system and not currently in use by the system don't change the port on the right side only on the left side of the colon next thing is the volume so that you can see they've got a DOT slash config folder here that's great and then down here they've got some other ones so again I'm going to put a dot slash in front of these because I want them all to be inside of this apparent folder this Docker Matrix as we go down you can see that it's got a thing where it's got to have postgres and the service needs to be healthy before it will start running which is good it checks to see if the database is there it can communicate and the database service is healthy next is internal and then unless stopped which is great and then it just names our different volumes that's awesome so we've made the few little changes that we need now what I'm going to do we're going to have to have this password in a little bit so we'll get it I'm just going to recheck everything here real quick and make sure everything looks good I think it does everything looks good all right we're gonna hit Ctrl o for Save and then we're gonna hit enter to confirm and then we're gonna do control X to exit and we have our Docker compose file now we have to generate some keys in order for dendrite to work correctly so we have a special command that we're going to run in order to generate those keys and it's going to run it right from this folder so if we run it from this Docker Matrix folder everything is going to be right where it needs to be so I'm going to paste this command in and this command in fact let me control C out of that clear this out and we'll paste it up here there we go this is Docker run and then we're going to remove it after we run it and the entry point doesn't have to be set it's going to create a volume which is in our current directory and then it's going to create it's going to map that to slash MNT inside of the container so it's going to pull down the matrix.org dendrite and monolith image the latest one and it's going to start it running it's going to run the command user bin generate Keys it's going to start it's going to create a key called the private key and it's going to put it in slash MNT slash Matrix key.pe I'm inside the container it's going to create our TLS cert and it's going to put that in slash MNT server CRT inside of our container and then one called TLS key and that's going to be in slash M and T slash server dot key inside of our container so it's going to put everything inside of the container and then it's just going to jump right back out so we're gonna let that run it's going to pull that stuff down and now that it's finishing out the extraction it's going to start the container running and it ran that and it created them so if we do an LS we'll see we've got those files right here because remember it mapped our current location to this slash MNT directory so we can see then we've got our Matrix key.pem server.cr CRT and server.key it's fine to leave them right where they're at nothing to do with them just know that they are there and that you need them the next thing we need is our yaml for dendrite our configuration file so we're going to copy that down into this folder so we're going to use wget again to go grab their sample file and it's going to save it in the config folder and it's going to be called dendrite.yaml now if you look right here we don't have a config folder yet so let's create that before we do this so you can use Ctrl C to jump out of that command so I'm going to say mkdir config I'm going to correct my spelling with move c-o-n-i-f-g to c-o-n-f-i-g config so it'll be spelled correctly I'm going to clear out the terminal I'm going to paste in the command we need and I'm just going to run it now if I go and I do Nano config slash dendrite.yaml you'll see that it's there and you can see this is a really long file they give you a lot of really good information in these comments anything with a hashtag in from it in front of it is a comment it's commented out it means that the system won't read it any line without the hashtag that's not a continuation of the line above anyways is a setting and you need to kind of know what those settings are you don't need to change a lot of them but you do need to know what they are and we'll start right here at the top and the first thing you're going to come to is the version two just leave that alone that's fine the next thing here is the is the host name so I've already set mine in here and it's chat.routmyhome.org is what we're setting up so you would set your hostname for that server in there the the URL that you want for that server to use the next one is important so this is where it's going to look for the private key which is slash M and T slash Matrix key.pem so you've got to keep in mind that it's got to be looking in the right place so when you pull it down it's just going to have this it's going to say Matrix underscore key.pem but if you remember when we created those files it actually mapped your your current directory which for me was in The Matrix or in the docker Matrix folder to slash M and T so we want to add slash MNT and then another slash here so that knows to look in the right place and then we're going to modify our Docker compose file to add this mapping for the slash MNT as well so that it knows where to look for these files and everything will work out pretty well so don't don't worry about it too much but this is just one change you'll probably want to make to make sure everything works correctly if you're getting errors about that it can't find the Matrix key for some reason this is probably one of the problems and then maybe the volume mapping in the compose file so as we continue down a lot of this stuff is going to be commented out and it's fine just leave it commented out I'll mention the things that you probably want to look at and change so again this thing here for the key validity period just leave it alone unless you know what you're doing you can change it the next thing you want to change is this connection string so here where it says user you want to put dendrite like I have here because that's the user we set in our darker and pose also in our darker compose we created a very long strong password you'll want to go copy that and then paste it right here before the at symbol you see the at symbol just make sure your your make sure your password does not have an at symbol in it and then here you're going to put this exact word if you're doing everything I'm doing and you're creating your folder structure the same way you're going to want to put Matrix dash postgres dash one and then a slash and then leave everything else the same so what you're going to have here is probably hostname slash you want to erase hostname and you want to put it in where it says Matrix dash postgres dash one this is going to be the name of the container when we actually start up the docker compose file and you'll want to make sure that everything there is set correctly so that it'll connect like it needs to so as we move down we're going to use the one gigabyte cache size that should be plenty there's no reason to change that that I'm aware of if you need to for some reason if you have a really huge system that's just hosting tens of thousands of users maybe you'll have to change this but if you're doing this for a home server for a small business 100 100 users probably you don't need to change this at all uh max age one hour that's fine so now here the well-known server name you'll probably just see two quotes two sets of double quotes that are empty nothing in them you'll want to put this structure so your url without the HTTP or anything just for me chat.routmehome.org we want to make sure I get this spelled correctly and then colon 443 so you want to put whatever your url is and then colon 443 as we move down we're going to use https colon slash slash chat.routmehome.org here now these are very important for you to make sure that your clients can connect and that you can do Federation it's not just for Federation but it's important that your clients can also use this to connect so people that are using client apps on their phones or on their desktops things like that you need to make sure these are set correctly these two things are fine as they are matrix.org and vector.im for identity it's great if you're going to set up your own identity server that's a whole other thing I'm not going to go through that right now I might do it in a future video but I don't know yet but just be aware you may want to just leave these alone if you're not setting up your own identity server and if you are you need to know how to change this and what to use disable Federation so I have this set to false if you're not wanting to Federate if you're just wanting to run your server as a standalone server then you'll want to change this to true if you want these items turned on make sure you you set these to enabled equals true report stats so this is statistics that would go to matrix.org just for them to understand how you're using your server what the server usage is how the server is behaving things like that it is all non it is all absolutely non-private data only if it's private data they don't try to get it they don't want to take it nothing like that it's up to you if you want to make this true or not if you make it true you're just helping them improve the product over time so understand that but if you don't want to make it true you can just leave this as false just just know that if you don't if you don't mind sharing change this to true all lower case and then just leave this URL alone and it'll do what it does so if you want to allow server notices as for for your admin account to be able to send messages to all users on the server then you would set this to true and I think it's a useful thing because maybe you want to let them know like hey this server is going to be down for maintenance for a little while things like that but that means anyone who has an admin role can send out those notices so just be aware that you're turning that on when you do I think you can leave everything else here the same I don't think you need to turn anything else different so just leave the rest of that as default so the app service API everything here I just left as it is I didn't change anything this one is important though registration disabled true that means registration is disabled you will have to create the accounts by hand if you want to enable registration you would change this to registration disabled as false but then you need to set up some other things you need to make sure your email is set up in here which I don't have even in this file right now you need to make sure that you've got recaptcha turned on and and set up correctly everything like that there's a lot going into registration to make sure that you're not creating a server where a bunch of people can get on and start spamming everybody um even if you don't enable registration so if you keep a registration disabled true like I have it here which means nobody can register on their own you can set a password so you set a long strong passphrase right here and then share that with the people who you want to allow to register after you've done that and maybe given them a day to go and register you might want to change this so that it doesn't accidentally leak out and you do again get spammers trying to register for your site but worthwhile to know that you can set this up and they can use that passphrase yeah so again recap has to be set up for registration there's a lot of things that have to be set up if you want to use that so just be aware of that they've got a little bit of default stuff here that you could try but um nothing that I'm turning on because again I'm not enabling registration on my on my server so on the turn certificates so if you want to have your server be able to make video calls phone calls things like that not but audio calls not phone calls but audio calls and video calls you need to set up a turn server um I highly recommend that you just set up your own co-turn server I'm going to go on into a video on how to do that next time and kind of explain how that works and it's useful for a lot of things it's not just for Matrix but for next Cloud all kinds of different things where you want to use turn as as a way to communicate behind a firewall inside of a network with video and audio it's very useful as we continue down so right here this is just an example of if you wanted to rate limit you can so this has rate limits already turned on but if you wanted someone to be exempt from the right limits you would just uh take out this little hashtag there and then put in the at and the username for that server and then you'd put in the actual server after the colon just like this and now that person is allowed to post without rate limits um if you don't want to do that just leave it comment it out and don't put anybody else in the list if you want to add other people to the list you again remove the comment go down one two three four five six spaces add a hyphen and then add the next person and chat dot route me home.org in my case you would put your server name of course and now you've got two people who can do this without a rate limit so it's up to you if you want to do that or not just be aware that's what it is and that's how you turn it that's how you enable it and then make sure that it's not set for certain people so I'm going to just put a hashtag back on there so this part is for the Federation API itself there's really nothing you need to change everything here should just be left as it is as far as I as I recall let's go down and kind of check some of those other settings yes everything here that was default I just left alone I didn't change any of it um this is how it came in the file so on the max file size right here this is going to be 10 megabytes if you want this to be bigger than 10 megabytes you can change this you can double this number essentially and make it 20 megabytes you can make it 40 megabytes whatever you want to do but it's tied to how it works in your reverse proxy and if you're using a reverse proxy like nginx then you would have to go and set this as also the client Max body size setting in nginx so I haven't done that so I'm just going to leave this as 10 megabytes because it seems like a plenty big enough type thing for an attachment to me Dynamic thumbnails is false again don't change any of these things unless you have a reason to and you know what you're doing so this real IP header is kind of up to you to use we're going to put it behind a reverse proxy now I haven't had an issue with anything except one client and maybe if I would turn this on for my other server it would work better I may try that but I've left it disabled and everything seems to be working fine right now behind a reverse proxy so I haven't turned it on but if you if you do have issues or you're seeing sync issues you could come and just again remove that hashtag and you should be set if you don't need it removed just put the hashtag back and it'll comment it back out configuration for the full text search engine I left all this stuff as it is I didn't change anything here but it's up to you the language is defaulted to English en so if you have a different language that you're wanting to use make sure it's a supported language and then you can change that to the two letter combination for the language you want uh the be Crypt cost here this just says how many times or how many rounds is it going to go when it's encrypting data and encrypting information the higher you go the more intense it is on the CPU and the Machine itself they say around 14 probably is about 20 minutes of encryption so just be aware of that you probably don't want to put it too high 10 is really pretty good I'd say leave it there unless you have a reason to make it higher you might get away with 12 if you have a really powerful machine I'm not going to run this on a super powerful machine so I'm not going to do that but I'd say leave it at 10 unless you have a reason to change it again so this one here on the auto join rooms whenever you create new users you can have them Auto join a room so what I've done is I've set this up as hashtag main for the room name and then colon again my my server so you'd want to make this whatever room name you want you can name this room whatever you want you just need to remember to create a room once you're logged in the first time that actually has this name and then it can be your server name right here and then when you create a new user they'll be automatically added to this room so they'll at least be in one room on your server and then they can start chatting or doing private chats or direct messages they want to and then finally on open tracing and logging there's nothing to change and that's really the file right there we've gone through it the dendrite.yaml file hope you've got everything saved and set up so I'm just going to hit uh so you're gonna hit Ctrl o to control o to save and then hit enter to confirm and then you're going to hit Ctrl X to exit out and we're just going to say no for that one on mine but you should be set with your dendrite.yaml file so we're just going to do CD dot dot now we're going to go into Nano Docker compose.yaml because we want to go in here and change one thing and I'll show you what it is so we were talking about that Matrix key.pem we want to make sure that we've got the right volume set so that it can find where that's at so we're going to go down here to the monolith section and you'll see right here I set a another volume item so all you have to do I'll just get rid of this so it looks exactly like yours and we'll just go ahead and add it again right here so we're going to go down here and we're just going to hit one two three four five six spaces hit a hyphen and we're going to do dot slash which just means in the current folder which is where our keys are at we're going to hit a colon and that means map it and we're going to put that to slash MNT we're going to hit Ctrl o to save enter to confirm everything else should already be set up here from earlier so you shouldn't have to change anything else and we're going to hit Ctrl X to exit and we're pretty much ready to start up our Docker compose file and pull down everything and get our system running all right to start this up we're going to do Docker compose up Dash D and then two Ampersand is Docker compose logs Dash F now I've already pulled everything down once the images and things but I don't have anything set for volumes yet so you're going to see this go up a little bit faster you might see yours actually pulling everything down the first time you run this just be patient you should come up and show you logs after everything's running so once this gets going it's going to start up the postgres database and you'll see it change from creating to waiting so it's waiting and then really it's waiting for it to start and once it starts then this is going to start going the monolith is going to start going there it goes we're going to get our logs it's going to give us some information so it says it's starting the external listener so everything should be up everything should be running we've got some information up here that says it looks like it's good so once you kind of see this message that it says it's listening on a certain Port which is 8008 we're going to go open up our browser open up a new tab and we're going to go to the IP address of our server and you'd want to go to the IP address of yours and then part 8008 so that's 192.68.10.73 for me and then colon 8008 and you should see something like this now I have the dark stuff turned on here I can disable that real quick it's going to look like this I apologize it's bright but this is how you'll know that things are up and running and it's going to tell you it works dendrite it's running so that's good we've gotten this far that's great now we know that's running the next thing we want to do is actually start setting up our reverse proxy so that we can get everything running the way we expect I'm going to go into nginx proxy manager and I'm going to hit add a new proxy right here and right here I'm just going to type in the name of my server or the URL for my server just like that and I'm going to hit tab just to make sure it turns into a little chip like that if you don't it may not show up there I'm going to drop down here to the IP address and I'm going to put in 192.168.10.73 and over here I'm going to put in 8008 I'm not going to cash SS actually I'm going to block common exploits I'm gonna do websocket support and I'm just going to click save before I do anything else I'm going to get set right here I'm just going to click on it and it should come right to that same page so it's in dark mode again but you see it's there so everything's good I'm gonna close that I'm gonna go back out here to the right for that entry I'm going to hit edit and I'm going to go over here to SSL I'm going to go request SSL certificate I'm going to say Force SSL HTTP 2 support and I'm going to make sure everything's there I'm going to turn on this and I'm going to hit save so this is going to go out to Let's encrypt say hey I've got a site I want you to challenge it make sure you can reach it on Port 80 and if you can give me a an actual CA certificate for it so it's really nice this makes it really easy and it did it so it should say let's encrypt when you're done that that little pop-up should just go away on its own and then you'll see let's encrypt on this row and now if we click we're going to see that it's got a certificate and it's it's secured with SSL so now we're reaching our Matrix site through SSL which is awesome now we need to create a user so we've done all of the hard part we've got everything up and running we're just going to hit Ctrl C here on the logs we'll clear this out and we need to create a user to do that we need to jump into our running system into into our container so we're going to do docker space exec space hyphen it which this means execute and then give me an interactive terminal and then I'm going to tell it which one I want I want Matrix Dash monolith and then I can hit tab it'll fill it out and I want slash bin slash sh so there I am I'm inside of my dendrite running monolith container so to create my first user I'm going to do Ctrl shift V here to paste and we're going to look at this command so we're going to go to slash user slash bin slash create account this is where this create account command is at slash user slash bin and then we're going to say hyphen config and we're going to tell it where the dendrite.yaml config is at so it's inside the container it's in the slash Etc dendrite slash dendrite.yml then we're going to say hyphen username and here we're going to put in the name that we want so we want to create an admin account that is not our normal ad it's not our normal account like our normal usage account so I'm going to call this Brian underscore admin so this will be my admin account I won't normally log into this unless I'm doing admin things and then we're going to put hyphen admin at the end so it should look like this user bin create account Dash config tell it where the config is Dash username and then your username underscore admin is a good idea and then Dash admin so that it knows it's creating an admin account I'm just going to hit enter it's going to ask me for a password I'm going to give it a nice strong password Here and one more time now you should really use a password manager to generate these passwords and then paste them in there just so you have them saved somewhere that's always better but I'm going to destroy this after we're done with this video created account so it says here's your account and here's your access token so this is a very special token you need to save so you want to grab this thing and you want to save this also to somewhere where you can get it again so we're done with that part now we can create other accounts so we can do this again we can hit the up arrow and instead of saying admin I'm just going to take that part off I'm going to take off the admin part I'm just going to create it with a username Brian and it's going to ask me for a password so I'll give it another strong password Here and confirm it and there we go and you see I get a different account our different access token for that non-admin user so now I've got two users which is great you can add more users as you go and you just keep repeating this so you can do this for Bill and again create a nice password for Bill and then you can do the same thing over and over and over you want to keep grabbing these access tokens these are useful whenever you're going to actually set up your login so now that we've got that we actually want to test this out and see if we can chat so we're going to go to element Dot well let's see we're gonna go do app.element.io so when you first come to the app.lmin.io webpage you're going to see this option you'll see sign in create account and explore rooms if you go to create account and actually try to do that with your with your server it's not going to work because you haven't enabled registration and we did it unintentionally now if you enable registration you could probably do this but we're going to go to sign in because we already created our account but right here where it says matrix.org we need to hit edit we're going to type in our URL chat.routmehome.org we're going to hit continue and it should come back and say everything's good okay it's going to say Home Server and foreign we want to sign in with our username which I created a normal user called Brian and I'll give it my password Here and we're going to say sign in now I don't have to say save here and I'm here so everything looks good help improve element I'm saying no and then there's no rooms I don't have any chats yet so I didn't create the main room yet that's kind of a problem so I can go down here and I can say add a room and I can call this me I can make this a public room and you should on the first one and we'll call this main just like I said where I wanted it to be the default room let's say create the room and there we go so now I can invite people to the room if I want to chat with people and I can of course chat in this room chat is here there we go all right we've got that set up we're going we're working everything's working good the next thing you have to do is actually set up port forwarding for Port 8448. now I can't tell you how to do this because every router on the planet does a different every router maker has a different way of setting up port forwarding you'll have to look it up for whatever your router and operating system are but you want to set up a forward that goes from the internet into your network for Port 8448 once you've done that you're going to go to a certain site and it's going to let you test to see whether or not you've actually got everything up and running so now I've already got it set up for my other server so I can't forward port 8448 to two different machines inside of my network so I won't be able to do it for the one we just set up but I will show it to you for the server that I'm running as my protection server so unfortunately it's a pretty easy URL to remember it is Federation tester.matrix.org it should bring you to a page like this and you're just going to type in the URL of your server so I'm going to put in Matrix Dot routemehome.org and I'm going to hit go it's going to go out there and check to see if it can reach my server using port 8448 and it should come back and give you something like this it says connection report and it says it connected and it'll have a bunch of information about your server and your IP address and things like that so you'll see all kinds of information here that it checked to kind of see what can it do and how does it work so if you get a good report like that everything is set up great if you don't if it fails for some reason you may have to go and dig in and make sure all of your settings are correct make sure all of your ports are set correctly things like that but 8448 is going to be the port for Federation all right finally a word on the clients that are out there for Matrix there are tons there are tons of clients for the mobile operating systems there are tons of clients for your desktop operating systems it's really going to be a personal choice for you the element client on iOS doesn't appear to respect the font size settings in iOS and does not have a setting of its own yet they do have a new app coming out called element X however it requires a new syncing protocol that is not built into the synapse server or the dendrite server yet so hopefully in a few months that'll be built in we can get an update we can get everything working and I can try out element X but today it doesn't work with my server which makes it a problem the good news is there's other ones out there called like fluffy chat is a really nice one on iOS and it does try to respect the font sizes although there's some weirdness about it but I've reported it and they've been very responsive so I'm hoping for a fix soon on that one that's great um on the desktop there's tons and and really in Linux in Windows and Mac you're going to find a bunch of different options you just need to find the one you like the best I'm just using the element client here on my desktop right now um pretty basic pretty great pretty easy to see and I kind of like it a lot so I think it's it's a pretty pretty nice chat client very easy for me to read which is great and it's got a nice dark mode or it's respecting my my desktop's dark mode theme which is awesome so I I've been using it um I did try cine I didn't like it as much uh fluffy chat I didn't try on the desktop yet but I think I might if they have a Linux client as well there's one called moment that I thought was just terrific and it works with matrix.org but it's not working with my server now again that could be that sync thing set up where I need to set up so I'm still not seeing thing but that sync setup that needs to be done with the xreel IP so maybe I'll go change that on my server and see if that makes a difference with moments it'd be great if it did because I really like that client it's very fast it's a QT C plus based client it's really great so there's a lot of options out there for for chat clients again I've set up co-turn so I'll go through that with you guys to set that up so that you can see what that's doing and working on the next video but I think this one we've gone really far you should be able to get in here and chat she better get people set up in your servers you'll get your server set up and running you should make sure Federation is working and then we'll get into setting up a turn server so you can actually do some audio and video calling which will just enhance the experience even more I hope you guys enjoyed this I hope you got a lot out of it if you did like subscribe tell your friends about it so they can come along in the open source Journey with us and I'll talk to you next time [Music] it's your open source Advocate and I'm back and I've set up a store with a little bit of merchandise I love being your open source Advocate but I want you guys to be the open source Advocates with me so if you want to get out there and get some of this stuff and if you do let me know what you think of it thank you for subscribing
Info
Channel: Awesome Open Source
Views: 30,374
Rating: undefined out of 5
Keywords: open, source, opensource, self, hosted, selfhosted, self-hosted, free, libre, software, server, web, internet, browser, linux, mac, macos, windows, microsoft, ios, desktop, tutorial, how to, setup, installation, instructions, command line, terminal, network, networking, news, projects, matrix, element, riot, dendrite, synapse, chat, messages, messaging, encrypted, encryption, e2e, end to end, voice, video, call, audio, text, push, notifications, rooms, private, public, family, business, signal, whatsapp, telegram, messenger, google, sip, voip
Id: TFDFR6EBG3k
Channel Id: undefined
Length: 46min 36sec (2796 seconds)
Published: Sat Aug 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.