Get your own VPS with 2 vCPU Cores, 8 GB RAM and 100 GB NVMe Disk space for just $5.99 per month with the KVM2 plan from Hostinger. Get an extra 10% off with the code DREAMSOFCODE by visiting hostinger.com/dreamsofcode
@AlexScotton-Illizian3 күн бұрын
Hot damn, that’s an amazing offer❤
@crowdsec6 күн бұрын
Hey thank you for checking us out! We realized that the install links in the readme were slightly outdated so we worked on refactoring this. Loved the video, a key takeaway I see is docker is great if you want to get started fast, but then the abstraction it provides can also impact how much you could learn by doing it the non docker way! - Laurence CrowdSec Support
@wchorski10 күн бұрын
Everyone should attempt to do this early on. Docker is nice but it abstracts away a lot of fundamentals. Once you do this you'll understand how to build Dockerfile(s) in a much more efficient way
@dreamsofcode10 күн бұрын
It was a really fun challenge! Definitely helped to learn a lot.
@fikrirahmatnurhidayat498810 күн бұрын
A lot of engineers on my country doesn't understand Docker at all, or even terminal. Like what you do as programmer man lol. I'm about to leave my company, but every single engineers there doesn't understand Docker on fundamental level, let alone, k8s.
@rd425379 күн бұрын
Most definitely great advice, I'm pretty OCD when it comes to my dockerfiles and have some really nice boilerplates as a result of knowing 'low level' sysadmin approaches. Ironically I did something very similar to this setup with a small vps recently, the only thing I'd change here is ufw in favor of nftables ... but it's negligible.
@SeattleSpursFan18829 күн бұрын
Completely agree.
@TyBohannon8 күн бұрын
💯
@NexusGamingRadical10 күн бұрын
I've been deploying without docker outside work because honestly its just simpler to me and requires less steps. Only bit that really benefits from Docker in my eyes is CI/CD.
@vaviloffx10 күн бұрын
As always, amazing stuff! (The identical intonation in every sentence is killing me though haha)
@americanbagel9 күн бұрын
Why did you mention that?? Why?? Now I can't unhear it
@brandonpark38939 күн бұрын
this is so awesome to see! i love how you edited this video with little things like the underlining, boxing animations, and making it a little more "fun", so my ADHD brain can focus a bit more. I really enjoyed how you tied in the different resources you tried and why or why not you went with them and the improvements section. I know for some, this is just knowledge they already have, but for newer people, this is invaluable! Just want to say thank you Elliott!
@disjustice10 күн бұрын
Remember when we had Tomcat and httpd and deploying a new version just involved pushing a .war file to a mvn repo? We even had these guys called sys-admins or operators who secured and configured the target platform for us... If you were lucky you even had this thing called a DBA who made sure the database was correctly configured and performant. As a backend dev, even logging into the production server used to mean I was having a really, really bad day, now it's just par for the course. Ah well.
@peterszarvas9410 күн бұрын
I am saving this video as a learning material. I did similar things but not this feature complete. Thanks!
@madebylewis8 күн бұрын
My day-to-day is the basic frontend/backend type workflow; your channel is my escape and hope that I keep chipping away at the layers to it all, and broaden my fundamental knowledge :)
@dudu9920010 күн бұрын
Great video, it's good to see the problems you encounter when doing it. It adds great value to the video because it's not just another generic tutorial
@ebourgess10 күн бұрын
This reminds me of my old job where we would use Capistrano to deploy Symfony apps, this brings back some memories, thanks for sharing this
@reverse46469 күн бұрын
@@ebourgess what do you use now to deploy symfony webapps?
@sarojregmi2009 күн бұрын
Was setting up a vps for personal usages, and I never knew what were the things i was doing wrong. Thanks it will serve as a great learning resources.
@aellionnecalara322310 күн бұрын
You can also manage user-level systemd services with `systemctl --user`. Great video btw!
@husanaaulia47178 күн бұрын
@@aellionnecalara3223 i don't know what's wrong on my Linux, but services under --user somehow not automatically started system restart🤔
@3nt3_3 күн бұрын
@@husanaaulia4717 you have to use other targets than for system services
@KadenCartwright3 күн бұрын
@husanaaulia4717 they will not start until the user logs in after a reboot
@MankepankeКүн бұрын
@@husanaaulia4717 they probably start when logging in
@abeeinspace13 сағат бұрын
@@husanaaulia4717 User-level systemd units don’t restart with the system itself by design. They start when a user logs in and exit when the user’s session gets torn down by logind upon logout
@Mr.BinarySniper10 күн бұрын
Wow.. this is So awesome. I was also deploying application in Raw way. but now I learned a lots of thing to improve..
@ZainSyed9 күн бұрын
Genuinely a very good test. We haven't done automated releases as of yet. We do use systemd, php-fpm and nginx on our production servers but don't do rolling releases nor CI/CD for now. We're thinking of going to docker route.
@sevos8 күн бұрын
Nice to see such a detailed video about working with default tools in the stack
@danygagnon844610 күн бұрын
This video is gold. I recommend looking into systemd sockets, timers and so on. There's so much going on and it is amazing. What I like about doing it this way is that you control all the permissions and networking stack, and you can work with the kernel directly
@inithinx10 күн бұрын
Now do it with NixOS!
@joebeurg10 күн бұрын
@@inithinx this one.
@Mr.BinarySniper10 күн бұрын
yeah. want a details video with NixOs.. 💯
@ImperiumLibertas10 күн бұрын
This is the way. Even if you use docker you can use nixos to provision the host is a consistent way. Nixos is an amazing tool.
@inithinx10 күн бұрын
Maybe use tools like terranix to deploy vps as well!
@dustee268010 күн бұрын
NixOS is the easiest tho
@mad_t7 күн бұрын
It amazes me that all this stuff is like rocket science for modern devs.
@blablabla-c5o5 сағат бұрын
wow. couple of my hair falls trying to imagining how difficult it is for you to do this. Well done boss
@personalaccount15154 күн бұрын
Excellent video dude!
@alpha2107 күн бұрын
You didn't really touch on zero downtime deployment... I guess it was implied that having load balancing you can upgrade only one endpoint at a time and catch the failure early on ?
@nothingtoseeherelolkek10 күн бұрын
Thanks! I’m more of a mobile guy but can start some docker containers and make my own. I’m barely knowledgeable enough to be dangerous. This can make my backed tooling much better!
@mjdmaxcoder9 күн бұрын
I just started offering vps with support for automated builds, vpn, public/private network, monitoring. It was a great learning experience. Learnt a lot about kvm, ebpf, built my own vm scheduler etc. Next thing in mind is to learn more about hypervisors, followed by fpga programming.
@thepi10 күн бұрын
Amazing video! I always strayed away from deploying my services directly, due to my perceived complexity of it. This video certainly gave me some motivation to try something similar. I usually used either docker compose, or, more recently, podman kube. I am probably going to spend my weekend trying out ansible and trying to deploy something without using containerisation.
@ivanmaglica2648 күн бұрын
Wow, this is pretty much (except for GH actions) our workflow pre-2020. I'll stick to Docker, thank you very much.
@nightwintertooth95026 сағат бұрын
I had to write an entire shell script and powershell script on the deployment side as a controller just to get it to work. It wasn't fun so this is a good video.
@Airprince4Күн бұрын
Thank you for being the only KZbinr who actually daily drives Zen Glad others actually appreciate the masterpiece that it is
@gaetanlehmann28249 күн бұрын
A interesting video that remind me how we did things without docker - that was 10 years ago! In my opinion docker major impact has been to make the dev and prod environment much more alike, and thus reduce the amount of bad surprises when moving to prod
@KaupoParmas9 күн бұрын
Great content! Never done this kind of deployment myself and going through the docker video right now to learn some best practices there. Would love a monitoring video, seems like there are so many tools out there right now that could help with that so it's hard to choose something.
@NoGoodNick_10 күн бұрын
Would it be reasonable to use something like ansible to make the setup repeatable and documented?
@__-se3tf10 күн бұрын
yeah, I think reproducibility is the biggest flaw I’m seeing too.
@ytdlgandalf10 күн бұрын
Ansible is a false god.
@NoGoodNick_10 күн бұрын
@ what’s your preferred approach?
@dreamsofcode10 күн бұрын
Agreed. I did mention at the end that if this ever became default, using an automation tool (ansible, tofu, etc) would be a must. Going to do a video on one or many this year!
@ytdlgandalf10 күн бұрын
If it's it infra level I'd use something immutable or terraform/tofu. Because that at least does some state checking. Ansible is fire and forget and still allows for configuration drift. It's like we al forgot what a horrible shitshow it was without containers. Nobody said it was difficult to deploy on a VPs. It's also not difficult to make it a incomprehensible unicorn at day 2 or any following dat.
@fadhilinjagi109021 сағат бұрын
Ansible + pm2 (if you're deploying node). Ansible is a little slower than running commands yourself but a lot faster than debugging compose files, building, pushing to private registry and then pulling the huge docker images on the server and running them with docker compose.
@shayes.x10 күн бұрын
Docker has a rootless mode, which does have its limitations, but in general can allow you to achieve high security standards equally as effectively (albeit perhaps less simply or intuitively)
@Deveyus10 күн бұрын
"Adding in a load bearing sleep" hurts my soul. I've written them and it harkens to my own sins.
@RuiPalmeira9 күн бұрын
I mean, I'm sure you and OP know about this stuff... if that is one way of doing it and it works... even if it's not "elegant", who cares? 😆
@Deveyus9 күн бұрын
@@RuiPalmeira That is a dangerous general approach to things; elegance often doesn't have to do with just looking pretty, it's about making sure that things work as well as they can, because all of the small little things like this accumulate and build up over time and degrade your setups; but the you of the future does not know where all of these are and it really becomes a massive pain to solve later.
@zz199917 күн бұрын
Caddy sounds great! I have been doings things in a similar way always, it seems the most logical/simple enough approach, you are aware of everything going on and don't have to reply on any third party (only the vps provider)
@vishaldinesh10 күн бұрын
Man you're quality is top notch
@kiyov0910 күн бұрын
Gold in the form of awesome content, as always!
@Shenepoy4 күн бұрын
I remember 4 years ago, I managed over 30 servers like this, and I just did a lot of cron jobs to do weekly, monthly status check and minor updates, and did templates for VMs to speed up any new deployment, at the end I created a janky way to use docker that works well enough without kubernetes a make it recover if an update caused any issues
@_Mackan10 күн бұрын
$17.99/mo for that vps without a 2 year contract is criminal
@ShootingUtah10 күн бұрын
Yeah but it ends up being under $150 for 2 years! If you had something running in GCP, even something EXTREMELY SMALL for 2 years you'll be spending more than that! Not to mention the risk of accidentally getting hacked and having someone mine monero on your system for $3800/hr. Don't ask me how I know! With this, even if the thing gets completely destroyed by hackers you're out $150 total! MUCH less risk especially for something that's not huge yet or never meant to make money.
@manishprivet7 күн бұрын
It's the best way to learn, Docker abstracts too many things. BTW, an improvement I would suggest is adding an `exit 1` when you are doing things like rollbacks. You want your CI to visibly fail when deployment was not successful.
@BlurryBit6 күн бұрын
"Docker abstracts too many things" - that''s a good thing in prod. That said, everyone should start with manual deployments before moving onto docker. Using docker without knowing the pitfalls is dangerous.
@ShootingUtah10 күн бұрын
I barely got my version of your docker example running! Haha now I'll have to redo everything without docker! By the way I used your link to Hostinger and I'm really happy with the product! I'm tempted to get another VPS without anything planned for it just to have one around.
@paw5653 күн бұрын
Wow! What an awesome and knowledge packed video.
@codeman99-dev9 күн бұрын
Thank you for checking out Caddy! Configuration that you can actually read in two months. No more "who the heck wrote this?!" ... "Oh wait, it was me!"
@includenull10 күн бұрын
8:05 Hey that's me! Great video as always!
@RazoBeckett.6 күн бұрын
Production Level ++
@yigitorhan7654Күн бұрын
One idea while using containers, in order to still take advantage of user permissions, is to use rootless podman instead of docker inside of your "deploy" user and autostart it as a user daemon using the --user flag for systemctl.
@ShootingUtah10 күн бұрын
Maybe this is just me but I find this much easier to follow than the Docker version. I've got a Docker version running my react website with a Go server and honestly I think leaving Docker out might be the better way to go in a lot of ways. Especially having like a 1 minute CI/CD deploy time! That's huge!
@manishprivet7 күн бұрын
Unfortunately no, while the 1 min CI/CD looks attractive, the biggest problem Docker solves is 100% reproducibility. When doing VPS based deployment, you also want to maintain your VPS for security patches and stuff, e.g., running `sudo apt update` every once in a while. They can actually end up catastrophic as your main server also depends on those updates, and any wrong thing there can put down your server. Plus, if in any case your VPS is dead, or you want to migrate, setting these things up again can be a pain, especially if you are doing it some years later, where the Ubuntu you used before is out of support, or something like that.
@ErikChacon10 сағат бұрын
Thanks!
@dreamsofcode9 сағат бұрын
Thank you so much for the support! I really appreciate it. 💪
@JSiuDev9 күн бұрын
Have been using Hostinger, docker, Caddy for years. Docker simplify config backup and system migration.
@Redyf10 күн бұрын
Wake up babe, new Dreams of Code video just dropped!
@Tristan-mr3pk8 күн бұрын
I’ve done almost all of this. It’s a quite fun process!
@hamzakhiar363610 күн бұрын
I love you, idk what to say I'm just thankful of your videos
@CameraShounen8 күн бұрын
A short video on using a secrets manager sounds interesting, I don't even know which options are popular nowadays (other than the cloud integrated ones of course)
@sheldon98c10 күн бұрын
I really miss my linux laptop. It broke last year and I'm forced to use company's macbook until I'm able to afford a nice laptop for myself. Seeing you using framework make me feel jealous 😅
@peterszarvas9410 күн бұрын
at least not windows
@agustinmdq8910 күн бұрын
Exciting video, a lot to learn! TY
@BlurryBit6 күн бұрын
I got the same message. Seriously considering switching to podman. Sure, I could use other tools like ansible or do it manually as well, but I prefer docker like environments specially for complex apps having multiple containers. It is a big hassle to maintain manually.
@markoveselinovic258610 күн бұрын
LOVE CADDY
@dreamsofcode10 күн бұрын
Caddy is pretty dope ngl
@trueberryless10 күн бұрын
25:54 What is "zeng commit"?
@dreamsofcode10 күн бұрын
I'll have to do a video about it! Not trying to plug the course too much but it's something that's built in it to auto generate commit messages.
@trueberryless10 күн бұрын
@@dreamsofcode That would be awesome! ❤️ I saw, that the commit message seemed kinda too good to be true. And I can also imagine that zeng is well integrated with semver because it prefixes with feat: and maybe also fix: and such keywords. However after googling zeng I didn't find anything related.
@trueberryless10 күн бұрын
I hope it's not something like gh-commit or anything that necessarily needs an OPENAI_KEY because I don't want to integrate AI at such small levels in my workflow tbh...
10 күн бұрын
To edit files that requires sudo powers you can use sudoedit.
@sasonbraha459910 күн бұрын
Really great video. Learned a lot.
@hxxzxtf10 күн бұрын
Now another worthy challenge would be to do this in FreeBSD 14.
10 күн бұрын
another great video! thank you buddy!
@dreamsofcode10 күн бұрын
Thank you!
@santerisiiranen39247 күн бұрын
The deployment step could have been more cleanly solved by leveraging OCI-artifacts natively supported by ghcr. This would have allowed you to store and version control bare binaries of your application and handle them like you would handle (Docker) containers
@EnhancedCookie5 күн бұрын
Very nice! Any thoughts on how you would add a full database (e.g. postgres) into the mix? Use a hosted service of some kind, through an ssh tunnel? Self-host with periodic backups into something S3-like?
@mintcar3 күн бұрын
Going to be interesting to see how you did these steps. Maybe I'm weird but despite using Docker at work, I feel like I don't know it well enough to comfortably deploy personal projects that way. I just started with bash, systemctl and nginx with automated deploys through ssh in a gitlab pipeline the very first vps I obtained. With Docker, nothing is actually simpler than that unless you deploy someone else's container or follow a step by step guide, right? I think I will eventually start to containerize things when I understand the technology fully.
@mintcar3 күн бұрын
Some great tips especially around security. I think that deploying without docker starts to look really simple if you take away the requirement of rolling releases and rollbacks, which you don't really need if you don't have any users.
@mikhailkalinin64846 күн бұрын
good teaching video. could you make another one under "how to automate configuration of the server" like using ansible, pupet or nixos to avoid manually operations
@theblckbird10 күн бұрын
Glad to hear, I wasn't the only one, who had Docker deleted by macOS
@dreamsofcode10 күн бұрын
Was kinda shocking when it popped up!
@devlix-src10 күн бұрын
It's a cool video, as usual the production level is off the charts! I did however enjoy the previous self hosting videos much more because they're actually applicable if you want to self host. This one was more of a thought experiment imo. I would have loved to see something on managing databases yourself on your self hosted service. This would provide much more value because you would learn the basics of self hosting including the database management/automation part. There are not many good tutorials on this as far as i know. Still thank you for making this video
@dreamsofcode10 күн бұрын
Managing databases is a great idea! Agreed, this one was more a "what if" I'm not sure I would recommend it over the other approaches that I took. That being said, Caddy is awesome and so was Crowdsec. I'll probably do some dedicated videos on them in the future.
@Diego-Garcia9 күн бұрын
As a lot of things... this was fun only because it was the first time doing it... Would recommend for personal projects, but never for it to be made in a company, that also would require you to document the entire environment for other person to work with.
@sypoo21208 күн бұрын
cool video, you have done a great job!
@vlmath31410 күн бұрын
day to day work for a sysadmin or devops. thanks for the video ;)
@nicolas_gama10 күн бұрын
Great video but for a production ready application we forgot monitoring (or completely ignored?)
@dreamsofcode10 күн бұрын
Timing constraints. I've got a couple of monitoring videos coming soon!
@AshishKumar-qi5gk9 күн бұрын
The NOPASSWD trick was sweet.
@Tantewillieja9 күн бұрын
Almost all VPS providers support cloud config. This is just a simple yaml config which initiates the full vps with correct ssh settings etc. Great to quickly get to your preferred config.
@Mooooov08159 күн бұрын
These deploy times! Our deployment pipeline from hell takes between 25 to 45 minutes to complete for a JS frontend
@d0cx8 күн бұрын
systemd services like we used to do before docker ?
@SanderCokart9 күн бұрын
Question: if your pc dies for whatever reason, and you cannot login via ssh, what do you do?
@matgod20049 күн бұрын
1 - Have a backup of the private key. 2 - Cry. 3 - If the VPS service has some "Console Terminal" function like hypervisors/VMs, you may still login as root by console usually.
@AmirparsaDD8 күн бұрын
I might even do this for a serious project coming up!
@yashramoliya45769 күн бұрын
Which linux distro are you using? Love to see a video on that. Thanks.☺
@meka499610 күн бұрын
You are the MAN! Thanks
@AniketBhatP9 күн бұрын
No setting up a cert, or adding the dns plugin for cloudflare or creating automatic renewal scripts?? Caddy has gained another fan
@rz2374Күн бұрын
where did you get that tmux notebook?
@Redditor5000-gg5pv10 күн бұрын
NixOS next?
@dreamsofcode10 күн бұрын
Yes!
@syth-19 күн бұрын
Already a huge help, checked ny ssh logs and theres a huge list of connections - didnt think it was set to default (password auth on) when im using key based entry,
@michaelns98879 күн бұрын
Please, also explain how to do PR previews
@fxfighter10 күн бұрын
The reduction in deployment time isn't insignificant. I took a look at the repo and the actual deploy times are sub 30s with the rolling deploy setup.
@dreamsofcode10 күн бұрын
Yeah, it's not huge. 10 minute deploys are still perfectly fine imho, but seeing it deploy in sub 1m is still great.
@thellamahunter9 күн бұрын
What is the screen behind Dreams of Code displaying?
@panagiotispapaemmanouil78165 күн бұрын
That video was gold 🪙 Thank you!
@rodemka9 күн бұрын
for ssh as you are the only user better try port-knocking with iptables: - no dependencies - no cpu usage
@bagfleet10 күн бұрын
Great vid!
@dreamsofcode10 күн бұрын
Thank you!
@shroomer38674 күн бұрын
23:30 please tell me that isn't the actual private SSH key
@akbng10 күн бұрын
Is that asciiquarium running on the background? And thanks for these videos, yt needs more vids on production ready deployments.
Is Zenbin by any chance inspired by the Snippetbox app you build when following the Let's Go book? 👀
@dreamsofcode10 күн бұрын
I've not actually read that book so it would be a coincidence!
@MrJxtr10 күн бұрын
@@dreamsofcode The concept is the same but yours is probably more thorough... but I saw a code snippet from your video and it looks like you are using templ? the book only uses the stdlib for templating.
@jonnyso18 күн бұрын
I always found docker to be an annoying middleman, it has its use cases but I find it kinda baffling that its the default way to do it nowdays. If I had a lot of dependency constraints and or had to deal with a lot of different version of my toolchains then I'd probably reach for it more often. I'm actually quite behind on the whole CI/CD thing because at the scale I've been working I never needed it, configure the server once, push code, just works.
@OldKing111005 күн бұрын
I think I'm too scared of becoming reliant on GHA or at least that's what I tell myself. I just use precommit to test locally and postcommit hooks to deploy using ssh and update script. For Golang I think it's fine to use git and build on the VPS as only the first build consumes a lot of resources. Restart to Status takes a bit under 3 seconds on a bad day for me.
@alcymn10 күн бұрын
Babe, put on the new Dreams Of Code
@rural_nerd9 күн бұрын
The banana cursor is hilarious
@betterwithmaul8 күн бұрын
me just like this for deploy my rust-api ssh remote to vps via github ci -> pull latest change -> build the app -> stop systemd service -> copy new build binary -> restart systemd service -> done
@leel26 күн бұрын
15:24 Bro is using GPT 4o MINI and was expecting working output haha