Advertisement
Justman10000

Manage Mailcow

May 28th, 2023 (edited)
1,216
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.80 KB | None | 0 0
  1. # You need Docker: https://pastebin.com/YTQNMvJw
  2. # For TLS support you need setup acme.sh: https://pastebin.com/VCVxg5uE (certbot is also possible, but you need Python for this! What i hate 😅)
  3.  
  4. // To install
  5. mkdir /home/mailcow
  6. cd /home/mailcow
  7. git init
  8. git remote add origin https://github.com/mailcow/mailcow-dockerized.git
  9. git pull origin master
  10. bash generate_config.sh
  11.  
  12. rm -r .* *.md LICENSE
  13. ln -s mailcow.conf .env
  14. chmod -R 777 .
  15.  
  16. # Now remove automatic generated certs and copy your real certs
  17. # Replace MY_DOMAIN with your real domain
  18. rm -r data/assets/ssl/cert.pem
  19. rm -r data/assets/ssl/key.pem
  20. ## Apache, Nginx and co
  21. cp /etc/letsencrypt/live/MY_DOMAIN/cert.pem data/assets/ssl/cert.pem
  22. cp /etc/letsencrypt/live/MY_DOMAIN/privkey.pem data/assets/ssl/key.pem
  23. ## Caddy
  24. cp /root/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/MY_DOMAIN/MY_DOMAIN.crt data/assets/ssl/cert.pem
  25. cp /root/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/MY_DOMAIN/MY_DOMAIN.key data/assets/ssl/key.pem
  26.  
  27. # Start Mailcow
  28. docker compose up -d
  29.  
  30.  
  31. // To restart services
  32. # If you need restart service (to restart Unbound*, for example), run this
  33. # Replace service_name with the real service name! Like nginx
  34. docker compose kill service_name-mailcow
  35. docker compose start service_name-mailcow
  36.  
  37. docker compose kill sogo-mailcow
  38. docker compose start sogo-mailcow
  39.  
  40. docker compose kill unbound-mailcow
  41. docker compose start unbound-mailcow
  42.  
  43. // To uninstall
  44. cd /home/mailcow
  45. docker compose kill
  46. docker compose down --volume --rmi all
  47. rm -r .* *
  48.  
  49.  
  50. * = Unbound is responsible for the DNS check and action!
  51.     Unbound checks the respective domains for their records and whether they are set correctly!
  52.     However, sometimes one need to restart it to have the record check run again
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement