<h1class="content-title">VPS set-up</h1><spanclass="content-meta"><pclass="author">[Phil Bajsicki]</p><pclass="date">2022-08-18</p><span>4 min read </span><ahref="http://localhost:1313/tags/vps">vps</a> <ahref="http://localhost:1313/tags/sysadmin">sysadmin</a> <ahref="http://localhost:1313/tags/servers">servers</a> <ahref="http://localhost:1313/categories/tech">@tech</a> </span></section>
<section><p>A few months ago I took up a project to centralize and collect all of my websites and email boxes.</p>
<p>I took some time researching what I needed, and settled on netcup.de for my host. The major reason is that they’re based in Germany, which means they comply with GDPR - this way I don’t have to worry about my data being processed in ways I don’t explicitly agree to.</p>
<p>Being European, I do tend to take my privacy for granted, and am reasonably careful not to contribute information about myself to businesses if I can avoid it. (Did you know that Facebook goes into overdrive with targeted advertising when you enter the US?)</p>
<p>I had no experience setting up servers before, aside from basic MySQL on Windows Server around the year 2007. Maybe 2008.</p>
<p>However… it turns out to be a really simple process if - like me - you’re using Linux as your daily driver. I normally run Arch, but after some quick research I found that it’s a bad choice for servers. Ubuntu it is.</p>
<p>So I installed Ubuntu. That’s one thing sorted.</p>
<p>Then I had to choose a web server. I had prior experience configuring Apache and nginx, and I found them unnecessarily complicated. I don’t plan to do anything more complex. Just a bunch of simple HTML files and a mail server.</p>
<p>I then found Caddy, and seeing its elegant and simple configuration, I was quickly sold. The setup was simple enough, and the configuration was easy. I pointed my domains to the server, and migrated most of my websites shortly.</p>
<p>I had previously used Wordpress, however I wanted to avoid the heavy and resource intensive nature of Wordpress. It’s not bad software by any means, but I am personally biased toward lighter solutions. Having been an Emacs user for years, it only made sense to use org-mode and export to HTML.</p>
<p>This way I only ever need a web server that serves files, and I don’t have to deal with databases.</p>
<p>Then the email server. I wanted this as simple as possible. I tried a number of solutions, and having issues with them, I settled on iRedMail. The installation was simple enough, but required that I handle its own webserver - it comes bundled with nginx for webmail access.</p>
<p>This turned Nita an entire project as I had to learn about handling SSL. Caddy procures its own certificates from Let’s Encrypt, and the nginx webmail didn’t like that because iRedMail generates local certs for itself.</p>
<p>I reconfigured Caddy to place its SSL files in a sheared directory and made nginx would read. Didn’t work, nginx complained. Eventually I gave up. Since the servers are on the same physical machine, and Caddy is the server facing the web, I let it do that, and removed the SSL option from nginx.</p>
<p>That solved my mail issues.</p>
<p>Thankfully& adding DKIM and DMARC to the domains was very straightforward.</p>
<p>Then… something interesting happened. My wife wanted to set up a Wordpress install for her new shirt store.</p>
<p>I chose MariaDB for the database. The set-up process for SQL DB’s hasn’t become any easier in the last 20 years, for inexplicable reasons. But with a small bit of research, I was able to follow the documentation, and set it up in a day from scratch.</p>
<p>The Wordpress install is entirely served by Caddy, and the setup was truly painless in comparison to setting up email. Still, I got it done.</p>
<p>The final set-up is like so:</p>
<ul>
<li>Ubuntu</li>
<li>Caddy</li>
<li>iRedMail</li>
<li>nginx (behind Caddy)</li>
<li>MariaDB</li>
<li>Wordpress</li>
<li>Emacs</li>
</ul>
<p>For the most part, the set-up was straightforward. The sticky points were SSL between Caddy and nginx, setting up the mail server (even though I used iRedMail, it required a bit of research to set up correctly. And MariaDB for Wordpress.</p>
<p>Sum total: about 10-12 hours of work. In retrospect, I’m confident I could set this up again in much less time, and it was a healthy learning experience.</p></section>