 are just coming to this video for the first time and haven't set up your domain, a transactional email service like Mailgun or a third-party object hosting or storage hosting service like S3. You may wanna watch the first part of this video, which is basically the prep. This part is really now we have the server setup, we have our Mailgun setup, we have Cloudflare setup, we have AWS's S3 setup. We are ready to now install Mastodon. That's where we are here and let's jump into it because this is gonna take a little bit to be clear. So there's that. I'm gonna actually shrink myself a bit. So give me a second. It's really just a way, yeah. Okay, so here is my VPS and Reclaim Cloud. Again, we're doing this in Reclaim Cloud. This is a tutorial for Reclaim Cloud. If you're trying to do it on another service, you probably want to find out what documentation they specifically have. We can use the command line web SSH built in if you don't have SSH keys added. If you do have SSH keys added, which I won't cover in this video, but if you do for Reclaim Cloud, you can also use your terminal on your computer, which is what I'm gonna do because it will make it easier to share what I'm doing and the screen. So I'm gonna copy this, get out of here, and then I will be actually sharing my terminal. So let me bring my terminal up. In Reclaim Cloud, when you have a VPS, you also will have a root username and password. It is safer to use an SSH key to be clear, but I'm gonna leave that up to you. This is the Mastodon official docs. I mentioned them in the first video where back at stocks.joinmastodon.org and then it's taking you through installing the application from source. And the thing I want to look at is I want to look at two things, preparing your machine and installing from source. So for right now, we're gonna look at prepare your machine. Then I'm gonna jump to install from source. So prepare your machine on the official Mastodon docs have a lot of info. They have how to do password based SSH, how to disable that. I'm not gonna show you that. Installing fail to ban again. It's great, but I'm not gonna show you that. I am just gonna update the system packages. I'm afraid that for someone who's fairly new to server management, which raises a question like, why do you wanna manage a Mastodon server? So keep that in mind. Some of this might lock you out if you're not familiar with it. And you don't need to install a firewall because we have one on Reclaim Cloud and I'll show you that in a bit. So the only thing I'm gonna use from preparing your machine is updating all of your packages. So that's it. So we're gonna go back to terminal and we will update all our packages. That's just pasting. I think the rest of this video is gonna be a lot of copying and pasting code to be clear. And I also wanna be clear like, I don't know exactly what all of the code I'm copying in is doing precisely. So please keep that in mind. Like, I'm not pretending. I'm a doctor, not a surgeon, Jim, is what I like to say. So now we're gonna go back to the installing from source. And this is the second link here with running Mastodon. And this is what we will spend the rest of the time working through. And I am going to copy this app install, perfect. So I'm gonna paste that in there. Looks a little weird, forgive me, that's because I moved everything around. But after that, it will work. And then I'll have a clean. Okay, so it is all installed. Now we're gonna go and grab no GS. No JS, sorry. So boom, put that in. And then we'll go through the command, all done. We're gonna grab post-grey SQL command. We're gonna put that in there. Again, a lot of copying and pasting. And then it went through, everything worked. We're gonna go to system packages. And this is our next update. Paste that right in there, boom. And you'll see it's working through the process. So there will be a couple of things along the way where we're gonna have to deviate a bit from this guide for it to work on Reclaim Cloud. Again, your mileage will vary on different services. This is really to get you up and running comfortably on Reclaim Cloud. As an aside, Mastodon 4 came out, I think yesterday, the official release. We'll still be running, I think it's 3.5.2. And then for those of you who are playing and wanna upgrade, we'll be walking you through the upgrade process. But for right now, I'm still using what's documented by Mastodon. So after that works, and it did, we're gonna go to our next command, which is yarn. We're gonna go Corpac Enable. And then we're gonna set the stable version of yarn. Paste and go. All right, so we're moving right along. Now we're gonna install Ruby. Can you dig it? Yes, and then I think they asked us to put in a name for the Ruby user. I just put in my name, and then all of that, I just go through. I really don't think they care about my office. My room number, 106 is my room number. So I have gone through that, that's all set. Now I'm gonna change my user to the Mastodon user. And you have to do that in Ruby to do stuff like use the CLI code and to install CLI command line interface terminal. Cause a lot of the commands you run for the server are text commands. So you will need to be a Mastodon user at certain points, you also need it for this installation, not root. So we are gonna go to our next piece, which is these commands, I'm gonna do them one by one. You will, on this second command here, see an error. An error, an error, error. Don't worry about that error. Taylor and I discovered that it's actually not a problem. It's this make file is obsolete, don't worry. It will be updated and taken care of for you. So you don't have to worry about that getting in the way of your install. So again, I am just going through this list of commands and I'm pasting them in. Not running into any problems yet, you'll notice. Not asking you to deviate from the plan just yet, you'll notice, but that will happen. So stay tuned, don't get cocky. Okay, so here we go. All of that is done and it says once this is done, we're gonna install the correct Ruby version. And so that is 3.0.3. I think for Mastodon 4, from what I understand, it needs a later Ruby version or a different Ruby version, we will see. You don't have to worry about that right now. And then after this has been installed, we're gonna make this the global version, 3.0.3. There it is, boom. All right, so we got it and they even tell you right there, run this command, which is the command that also the Mastodon documentation tells you to run. So it's perfect. So we're gonna get in there and we're gonna run that command. So next thing is the gem bundler. We're gonna put that in there and install the bundler and that has worked. And then finally, we're gonna exit out. And this means we're exiting out of the Mastodon user. So now we're back to root. As you can see here, we are back as root user. Here is where I'm gonna ask you to do two things that aren't in this tutorial. It's basically system CTL, start, and then we're gonna do post gree sql. So basically what we're asking the system to do is start post gree sql. And it should do that, right, and it did. And then we're gonna do the same thing for another service called readis, which is kind of like an object replication service, I believe, and post gree sql is the database. So we're basically starting both these services. This is important, otherwise you'll get errors in the next part. So this is not in the official documentation, but you're gonna need to do it. Once you've done that, we're gonna go in and we're gonna create a sudo. We're gonna create a user for post gree. We'll do that. It will be like, hey, I don't know if it will say yeah. It did have a little bit of permission denied, not an issue, don't worry. That will not create a problem for you, so that's not an error you need to worry about. And then here we're gonna create a user mastodon and that worked. Boom. Finally, finally, we're gonna switch back to mastodon. Well, not finally, we have more to do. Far from finally. And then we're going to run the actual latest stable release of GitHub. So I wonder, this will be interesting. This might push us to four if it's a latest stable release. And if it does, I wonder what that will look like. I don't know if it's doing that automatically, but it will be interesting. So the last piece is we're gonna install some dependencies for Ruby and JavaScript. And so again, they're right there. You'll see I'm copying and pasting from the guide. And this is all, again, a lot of copying and pasting and sometimes waiting for this stuff to run. This one is gonna be a little bit longer. You're gonna see a bunch of packages being installed. Bundle, ah, there it is. It does, it's pulling from the latest version. Why do I know this? Because it's saying that the version should be 3.0.3. And this one is looking for 3.0.4, which means this is trying to install MasterDom 4.0. And that also means we might wanna try and update the version. I'm going a little bit off script here. I'm gonna go back here to where it said this, 303. And I'm gonna try 3.0.4 here. I'm gonna exit out, right? Because I don't wanna be, no, I do wanna be a MasterDom user, so hold on. I'm gonna do that. I'm gonna do .4, because that's what it's looking for. But it's 3.0.4. I am gonna, that worked. I am going to put this, and I'm gonna see if this works. I'm gonna put this as four now. It worked, okay. Will this work? I don't know. This is now, we're off script pretty much, which was not what I wanted to do here, but it's what happened. So, at this point, we're going back. We're still MasterDom. And this is the point, I'm gonna try this again. Bundle configuration deployment. Try this. That worked. Then we're gonna do development test. Bundle config without development test. That worked. And then we're gonna do this. Bundle install. And it's gonna look for 3.0.4 and will that work? It did. How awesome. So we, ladies and gentlemen, may have MasterDom 4.0 for your pains. And you'll notice what I did. I installed basically Ruby 3.0.4. I made that the global setting rather than 3.0.3. Whether it works or not, we will see. That's a whole different story. But I think it will. That's my opinion, man. Okay, we're done here. And then we're gonna do the yarn install pure lock file. And at this point, we are probably ready to get to the interactive setup wizard. So we did all that. Just getting the packages for Ruby and setting up PostgreSQL and Redis and all the different packages this server needs. That's what we've gone through. And at this point, everything should be there. And now we're going through the setup wizard that MasterDom provides to put in some of the things like your domain name, the email settings and other things like that. So this is where it actually gets kind of interesting and all the pre-work we did will now pay off. Okay, let's grab it. This is it. Rails environment. We're gonna click here and we're gonna paste and we're gonna go. And at this point, it's gonna say what is your domain name? Your domain name and this should not change. And I think they even warn you. They're like, look, your instance is identified by its domain name. Changing it afterwards will break things. Don't do it. So domain name, DS106.social. Do you want Singer user enabled? Now this is a good question. Do you want this to be just a server for you and you're not letting anyone in and it's just gonna default to your MasterDom or is it for a community? If it's for a community, you're gonna want to say, I don't want to enable Singer user. So no, and that's what the default is. If it's just for you, then you're gonna want to say yes, which is not the default. I am gonna treat this like it's a community server. So I'm gonna go with the default. Are you using Docker to run MasterDom? No, one day maybe. Postgre host, all default. All default for the port, all default for the database, default for the user. And then password, also default. Boom, done, right? You don't have to add anything on Postgre SQL. Same with Redis. Boom, boom, boom, done. Do you want to store uploaded files on the cloud? Yes, it's not the default. And in fact, to be fair, you could click no here and they could go to your server and you'd be fine. You wouldn't have to worry about the AWS setup. We recommend you don't do that in Reclaim Cloud. You get an AWS S3 bucket or something else because if you're gonna scale this thing, you're probably gonna need that to happen. So there's your warning. So do you want to store uploaded files on the cloud? Yes, I do. Are you gonna use, ooh, DigitalOceanSpaces was just added. This was not an option yesterday. So that means they now work with DigitalOceanSpaces, which is cool to see, not with Amazon's, not with CloudFlare's R2 yet, but I would probably recommend using DigitalOceanSpaces given they're easier than S3, a lot easier. But anyway, I set up S3, so let's do it. But this is super good to know. Okay, what is my bucket name? My bucket name is DS106Social, right? That is my region, US-East-1. That's why I picked it because I knew it was the default. Whatever your region is though, you're gonna need to put that in there. And then my Amazon host name is actually just S3.AmazonAWS.com. So S3.AmazonAWS.com. And know it says it should be something else? Don't, put in this. At least that's what I've had luck with. Access key, that's the stuff we got earlier on. So I'm gonna grab that. Our access key is here. And then I'm gonna do my secret key as well. So let's get the secret key, there we go. And then we're gonna paste that. Do you want to access the upload files from your own domain? This would be if you mapped a domain, something like files.DS106.Social, you can do this. I didn't set this up as an alias. You can, it's basically called the domain alias. I'm gonna say no. Do you want to send emails from your local host? No, you don't. You want to send them from Mailgun. That's why we set up Mailgun. So this is default, no. And then we're gonna go with smtp.mailgun.org. If it changes, if you are doing it from EU, you're gonna have to change this. So it won't be the default. 587 default. Username is that postmaster at ds106.Social. Beautiful. And then the password is the password that I reset when I was setting this up. So I'm gonna go grab that. And one of the things I really like about the mastodon setup wizard is that it tests this for you. It's like, okay, let's test it. And then none, enable start TTLS. This is a new settings. And I'm gonna say auto. I don't know, that's new. Notifications at ds106.Social, this is the send from. That's gonna come up and that's fine because this is just notifying people. Send a test, yes. I wanna test it and see if my setting worked. Send test to myself, Jim Groom at gmail.com. And then if there are problems, I can trouble shoot them here. Yes, and it worked. Do I wanna save this? Default is yes and yes is the answer. Now that this is saved, the database schema must be loaded. So prepare database now, yes default. And then it's gonna do, I think one more thing where yeah, compile assets, yes. We're gonna do that. And this can take some resources. So keep that in mind. We put about four gigs and that should be fine here. Don't worry about this warning, not an issue. And everything is compiling. This is great. And it just might happen that we have Mastathon 4 set up. So we will see. Do you wanna create an admin user straight away? Yes, I'm gonna create one. I'm gonna call it admin because I'm just gonna go with the default. And then I'm gonna copy the password because they do give you a password here. Copy it, otherwise it's gonna be a pain to reset it. And then the email, I'm gonna put Jim Groom at gmail.com. And so this is basically creating a user for you. And then this is the password. I'm gonna copy that. We're done with this part of the setup. So this is installing the application and that's working. But now, or we think it's working. We still have something else to do though before we can go and look at the site. And you'll see here that we need to, we now wanna exit this, right? And that's gonna ask us to do a couple other things. We're gonna now set up Nginx. And this is where things, again, are gonna deviate a little bit from this guide because there are some tweaks we have to do to get it to work on Reclaim Cloud. Not to mention we have a firewall built in that we're gonna want to add a couple of settings to. So we're gonna follow their advice here because this is something we're gonna need. We'll be going over to our server and look at the interface. We're gonna copy over the Nginx.com file to sites available mastodon. So that's all we've done. And then the second command is just creating a sim link to something called sites enabled. So we have sites available and sites enabled. And they're basically copying over the same file. They're linking these two directories. So whatever you do the sites available also happens to enable. That's all that's happening. Okay. And then we gotta go in and edit them and replace all the example.com sites with whatever your domain is. In my case, DS106.Social. Whatever your case, it will be your domain. And then we're gonna get a SL cert. Before we do that, we have to do a couple of things. I am going to hide the terminal for the moment, okay. And then I am going to go back here to our server on social DS106. And in Reclaim Cloud, there's a little config space here. And this is actually kind of like the file manager on C-Panel. And you can actually find various directories that you need to edit various files. For example, mastodon is located on your server in home and then mastodon and then live. And you can actually add this folder as a favorite and it will show up here. And that means you can access it pretty cleanly. The other area I recommend you favorite is ETC and then Nginx. Because Nginx will be where we edit some of the settings. And I think I passed it, I did. So I'm gonna wanna add this as a favorite. And then I can go into Nginx cleanly and sites available, sites enabled. I wanna go into the sites available and I wanna edit this mastodon file. So I'm gonna go here, open. And these are the things I'm gonna wanna do. I'm gonna wanna make sure, like they said, anything that's example.com is now DS106.social. DS106 and then I'm gonna copy and paste that which will make my life a little bit easier. There's another one, there's for all told. So, and then there's the folders within the SSL certs that are gonna be created that have to have the right domain. Those are the changes we need to make for the domain. There's one more change we need to make. It's we need to comment out these two listen lines for listen 443 and we need to go in here and go to these two and copy the other two beneath them and you'll see why I'm doing that in a second because for some reason on Reclaim Cloud this SSL HTTP commands stop it from running Nginx and we're gonna have to run Nginx. So by editing these two lines and replacing them with these we're able to start Nginx and do everything we need to do but then we'll come back and uncomment and get rid of these two lines we added. So stay tuned for that. But I can now edit this. The other things I do and I've had luck with and your mileage may vary but I think this will, I know it will work at least in the instance of Reclaim Cloud is this default one, you can delete this. Insights available. So delete that and go to Mastodon and rename this file default. So I'm just gonna call here, go from Mastodon and call this default like that. And then the other thing I'm gonna do, the final bit, is I'm gonna go into the Nginx config file. So that's here, where is it? There it is. I'm gonna go to this main Nginx config file. I'm gonna open it and I am going to edit this. Right now it looks for all files insights available. I'm gonna focus it to make sure it only looks for default. So that's on line 60 of the Nginx.com file. I'm gonna rename this from the wildcard or asterisk to default. So it specifically looks for that one. Okay, having done that, I'm gonna bring my terminal back up and I am going to start Nginx on this server. So it's just like what we did when we started Postgre SQL as well as Redis. We're gonna go start and then Nginx. And we're gonna do this and it worked. How do I know there was not an error message? That's a really good sign. One thing I'm gonna recommend you do in Reclaim Cloud is I'm gonna recommend you look for the firewall of your server. So in this settings area, click here, you'll see on the left, there's an area called firewall. For the purposes of this, we can do a couple of things and I'm gonna recommend you add a couple of rules to your firewall. One of them is HTTPS, right? And we're gonna do that over TCP and UDP and we're gonna add that. The other one is HTTP. So let's do that. And then we're gonna do this and then we're gonna do this over both TCP and UDP add. And so now we have those rules in there for when we turn the firewall back on because I am gonna turn the firewall off right now. Not recommended to keep it off, keep in mind, but for now I am turning it off as I run this let's encrypt cert bot. Keep in mind, I turned off the firewall and added a couple of ports or opened a couple of ports. Now, if I bring my terminal back up, I am gonna do this last bit, which is the cert bot command. And this is gonna try and get a SSL cert for my server. Let's see. So there it is. And then I'm gonna go DS106.social and I'm gonna click here and all things being equal, it's gonna say it worked, it worked. But we will see. Yes, I'm fine with that. Okay, yes. And then yes. Yes, it worked. Yes, I ran into issues with this in the last one, not this one. Now the SSL cert is running. So before we can go to the main site and look at the Macedon that's installed, which might be version four, which is pretty cool. But before we do that, we have to go back and do one more thing. So I'm gonna get rid of the terminal. I'm gonna go back to reclaim cloud. And at this point, I need to go into the config for Nginx again. And I'm gonna go into the sites available. So let me go back here to directories and here's the sites available. This is where we edited that default file or the Macedon file and then renamed it default. I'm gonna go back in there and I'm gonna do a couple of things here. I'm gonna uncomment the lines we created here. So remember that. I'm gonna uncomment these two. And then I'm gonna get rid of these other two that we added. So there's that. So I've kind of replaced it to how it was. Uncommenting the server, these four lines beneath it and then this line beneath it. So this whole server block needs to be uncommented. So you're starting with the one with 443. So I recommend that you uncomment this entire server block or you can copy and delete it. Kind of better to keep it in there and uncomment it. After that, you would save this file and then it's always important after you change anything in Nginx. Go to my last command, which is systemctl restart Nginx. That and there's no error, which is a good sign. Now if I go to ds106.social, it should work. So yes, that's Macedon. So I'm gonna sign in with the admin and that password that we got just to see if it's on four. So that was the one we specified, the Macedon admin password. And I told you to copy that down. And so, oh, so the email, it actually wants the admin email associated with that username, which is jimgurum.gmail.com. There's my password and we're in. It works and are we on? Yes, we're on version 4.0.2. So this is an actual Macedon 4. Now one more thing we're gonna try and then we'll know, we now know that email works. We know that the install worked. Now we have to see if offloading files to S3 worked. That's our final test. And I'll go here and I'll find an image. I have an image on my desktop that I can use and I'm gonna upload it and did it work. It did. Yes, images are offloaded to S3. Everything pretty much worked as expected. This is awesome. If you have questions, reach out. This is now not Amazon. I mean, Macedon 3.5.x, whatever that is, 2.3. It is 4.0.2. Rock not rot.