selfhosting-blogposts/rainloop/index.md

110 lines
2.7 KiB
Markdown

---
search:
exclude: true
---
# Rainloop Setup
Rent a VPS with debian 10+ (or just run it yourself, but make sure it is correctly port forwarded so that public ip points to the machine like a vps).
Once you have ssh'd into your debian server as root, we can start:
## **Initial Setup**
First install all the dependencies:
apt install php7.4 php7.4-common php7.4-curl php7.4-xml php7.4-fpm php7.4-json php7.4-dev php7.4-mysql nginx curl socat unzip -y
Then configure nginx:
wget https://blog.nowhere.moe/servers/rainloop/rainloop.conf -O /etc/nginx/sites-available/rainloop.conf
nano /etc/nginx/sites-available/rainloop.conf
![](2.png)
Here make sure you edit the configuration file properly so that the domain name matches your own domain name. once you're done editing the file, hit CTRL+S to save and CTRL+X to exit nano. If you don't have a domain name, just go for a free alternative like [DuckDNS](https://www.duckdns.org).
![](0.png)
You can verify it is working by doing the following:
![](1.png)
Next we're going to get a free letsencrypt SSL certificate using acme.sh:
wget -O - https://get.acme.sh | sh
source ~/.bashrc
systemctl stop nginx
acme.sh --issue --standalone -d ech2.duckdns.org -k 4096
systemctl start nginx
![](3.png)
Next we enable the site:
ln -s /etc/nginx/sites-available/rainloop.conf /etc/nginx/sites-enabled/rainloop.conf
nginx -t
systemctl restart nginx
Once that's done, reload nginx and install rainloop:
cd /opt
wget http://www.rainloop.net/repository/webmail/rainloop-community-latest.zip
unzip rainloop-community-latest.zip -d /var/www/
chown www-data: -R /var/www/
Next configure php7.4-fpm correctly:
cd /etc/php/7.4/
echo 'date.timezone = Europe/Paris' >> fpm/php.ini
echo 'date.timezone = Europe/Paris' >> cli/php.ini
systemctl enable --now php7.4-fpm nginx
systemctl restart php7.4-fpm nginx
Once that's done, simply browse to your website:
![](4.png)
You need to browse to the url "https://ech2.duckdns.org/?admin", The default admin password is admin:12345
![](5.png)
Once you're logged in, make sure to change the admin password
![](6.png) ![](7.png)
And you're done! now you simply need to configure rainloop and test if it is working, so log out, and go back to the root directory https://ech2.duckdns.org/:
##
## **Linking it to an existing SMTP server**
Follow this [tutorial](../mail2/index.md) on how to setup a SMTP server:
![](16.png) ![](17.png) ![](18.png) ![](19.png)
And now try to login:
![](20.png)
And that's it! We managed to login:
![](21.png)