Expirence of Hosting a Personal Moqui Server on AWS

I recently setup a personal Moqui server on Amazon Web Services (AWS), and I’d like to share some of the things that I learned while setting it up.

The main reasons to set this up for me are to keep track of time spent on consulting projects, get more familiar with using Moqui on a day to day basis, create some new interesting applications and integrations for moqui, and have Moqui automate some of my repetitive tasks. I also am going to use it as a way to backup important files between my desktop machines with a systemd service that I wrote.

I ended up with an EC2 t2.small server on Debian 10 running moqui with an RDS db.t2.micro server running PostgreSQL. In AWS the EC2 servers are basically just a virtual server with a limited amount of cpu and ram. The t2.small server that I ended up using was 1 cpu and 2gb of ram. This seems to work well, although I noticed that occasionally I would run into using too much memory so I set the java max memory to 512mb by putting export JAVA_TOOL_OPTIONS="-Xmx512m" at the end of my .bashrc file. Setting it to 1024mb seemed to have problems despite the server having 2gb of ram. For the setup, I’m actually not running it in a docker container so that it’s easier for me to have access to the files as I’m going to be doing quite a few deploys on it often and making a docker image for all of them would become tedious.

For this server, I am running an nginx proxy on ports 80 and 443 that forward to port 8080 (the default port for running moqui). To Install nginx, I used the documentation for nginx.org, the beginner’s guide for setting up the proxy server, and the server names documentation for hosting the domain names.

The reason why I have the RDS server is because, for the long term, I want to be able to easily backup my database while also keeping the total load on my EC2 server down. AWS makes it really easy (basically automatic) to backup an RDS database to an S3 bucket. S3 buckets is basically just an ssd allocated with a certain amount of storage. To actually have my EC2 instance connect to my RDS instance, I had to create a Security Group that only allowed port 5432 (the port for postgres) from my other server’s local ip address.

So yeah there’s an informal introduction to doing a small scale production deploy of moqui. Let me know if there’s other questions.

2 Likes