Skip to content
Back

[SOLVED] How do I get SSL working in DigitalOcean?

  • 0
  • Self Hosted
  • Cloud
nightwielder
1 Jun, 2023, 17:07

Hello! I created an AppWrite droplet in DigitalOcean from the official template. Initially, it was in an IP address. But now that I'm ready to move out of the development phase, I wanted it to live in a doman name. So I went ahead and bought a domain i.e. myapp.com. Then created an A record(server.myapp.com). It works, but there's no SSL going on. What do I need to do now? Thanks in advance.

TL;DR
To get SSL working in DigitalOcean with AppWrite, you need to follow these steps: 1. SSH into your droplet. 2. Edit the `/root/appwrite/.env` file and set the values of `_APP_DOMAIN` and `_APP_DOMAIN_TARGET` to be `server.myapp.com`. 3. Set the value of `_APP_OPTIONS_FORCE_HTTPS` to `enabled`. 4. Run `docker compose up -d` in the `/root/appwrite` folder. 5. Run `docker exec -it appwrite ssl` in the `/root/appwrite` folder. 6. Check if accessing `server.myapp.com
Binyamin
1 Jun, 2023, 17:13

Hey, Sure. You'll need to add your domain in the .env file

  • SSH into your droplet
  • Edit the /root/appwrite/.env file
  • Set the value of _APP_DOMAIN to be server.myapp.com
  • Also, set the value of _APP_DOMAIN_TARGET to be server.myapp.com
  • Set the the value of _APP_OPTIONS_FORCE_HTTPS to be enabled
  • Run docker compose up -d in the folder /root/appwrite
  • Run docker exec -it appwrite ssl in the folder /root/appwrite

Check if accessing server.myapp.com will redirect you to a https with a valid certifcate.

P.s. sometime as the browser keeps small cache for SSL, it'll be best to restart the browser.

Binyamin
1 Jun, 2023, 17:13
nightwielder
1 Jun, 2023, 17:41

Thank you so much! Worked like magic.

nightwielder
1 Jun, 2023, 17:42

[SOLVED] How do I get SSL working in DigitalOcean?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more