Arch Server

The majority of the process to set up this server was followed from here. Here I will outline where I deviated and use workarounds to make all this work on Arch Linux.


Register a Domain -> Create SSH Key


Create Your Server


Attach Storage -> Point Your Domain Here


SSH Into Root


Create Your Username


Another User?


Secure Your login


Format Storage

Here I deviated much more from the steps so I will write out the steps used without referring to Derek's original document.



We don't need to deal with these complex commands each time. We can use aliasing to substitute much simpler commands to remember instead.



This will still need 2 commands to mount, and 2 more to unmount. I like having these aliased separately just in case I want to run one without the other for some reason. To bring this to 1 command for each I will make 2 more aliases using the ones I just created. You could make each of these 2 using the expanded commands above, but I find this way simpler to read.



Use Your Storage


FreeFileSync


Verify and Unmount


Web Server

Ports are not open externally by defaul on Arch. sudo ufw 80 will open the port for the web server. Do not open unnecessary ports. Arch is fully capable of hosting an apache server like is used in the guide. I prefer Nginx and so used that. The configuration is a little more complex than apache but I am more familiar with it and it works well for single site hosting.



When I was testing I was serving static content from /srv/http/domain.com/public_html. In the /etc/nginx/nginx.conf file in the http block I added:


    server {:
        server_name yourdomain www.yourdomain
        location / {:
            root /srv/http/yourdomain/public_html
        }
    }
    

Run nginx -s reload to reload the configuration file.

Then the html files to be served can be put in whatever folder specified in root and will be served from there. In the end I have my website built and served using SvelteKit and Nginx is working as a proxy for that program. I will go into Svelte in the future.

To have a secure webserver (https) I need a certificate.


To run this renewal periodically I made certref file in bin containing:


    #!/bin/bash
    sudo certbot renew
    

Set permissions to 700 with sudo chmod 700 bin/certref, then added a cronjob to run the refresh once a month.


Simple Website

Can use exactly what is in the guide here. Just make sure the files are located in the root you specified in the Nginx configuration above.


File Sharing With Pub

Did not set this up with Nginx yet. If I do will update this.


Calendar and Contacts

This is very similar for both Arch and OpenBSD so will list changes Arch does not have htpasswd by default. Install with sudo pacman -S apache then continue.



Android and Iphone + Test


Backups


Email

I decided to use an external email provider (FastMail) instead of setting up the email verification myself. This was before the explanation for this was published in this article. May try again in the future but for now I am happy with my own email for a few dollars a month that I can move to a different provider if needed


Git

I use git extensively in my coding projects, configurations, and notes so I wanted to be able to host my own git server.



To make a new project I navigate to /srv/git and make a new project with git -bare init <projectName>.git. Set ownership to git user with chown <projectName>.git git:git. To set the remote origin for a project that is already initialized git remote add origin git@url:/srv/git/<projectName> To clone a project from remote to local git clone git://url/<projectName> localName


Evolving

This project is slowly but constantly evolving. The above state is how it is running currently and that may change. I will endeavor to update it when things do. Slowly grow from something mostly taken from Derek's guide (thank you so much for that) to something uniquely my own and serving the my exact needs.