DNSAfter you set the DNS record on your domain name registrar, change the bindIp from your IP to your domain in mongod.cfg. Then you can access your database by the domain name.DDNSAbout how to set up DDNS, you can check my previous article: https://medium.com/@xdxxxx4713/set-up-ddns-with-ddclient-google-domains-2eee300126d0.After DDNS setting up, change the bindIp settings to bindIpAll: true .TLS/SSLTo secure the data when the transmission, we can use TLS/SSL in MongoDB.obtain certificateI use Let’s Encript to obtain the certificate. You can see the detail in this article: https://medium.com/@xdxxxx4713/lets-encrypt-in-nginx-85866b848c8e.mongo.pemWe need to cat the private key and the fullchain file into one pem file. Let’s call it mongo.pem .sudo cat /etc/letsencrypt/archive/’+[db_domain]+’/{fullchain1.pem,privkey1.pem} | sudo tee /etc/letsencrypt/live/’+[db_domain]+’/mongo.pemmongod.cfgSince TLS is more secure than SSL, let’s use TLS.In MongoDB config file, set TLS mode and the certificate file.auto renew mongo.pem and restart MongoDBDue to the certificate obtained from Let’s Encript would be expired after 90 days, I write a script to auto renew mongo.pem and restart MongoDB.client connectTo use URI connect, add ?tls=true&tlsAllowInvalidCertificate=true after your normal URL to connect MongoDB.mongodumpTo bake-up your data, you can use mongodump . Since we use TLS/SSL now, we need to add--ssl --tlsInsecure options for mongodump.