By sarogersz
I have a VueJS web app that uses MariaDB for database. I have had this running fine on my droplet, without HTTPS, and I added SSL using Let’s Encrypt. The app continued to work for awhile, but then stopped for some reason, apparently a bug in the code (I didn’t change the code). In any event I have been working on getting it back up and running.
I realize now that the easy SSL process I used did not update MariaDB for using SSL, so I started looking at that. This looks like a very involved procedure that I’m not currently ready to tackle.
I am considering various options for the current alpha release of the app, which include:
Obviously I am not an expert in this SSL topic…
I am looking for advice. My priorities:
Through the alpha phase I will learn much more about deployment and DevOps, and become much more knowledgeable about managing a fully secured and performant web app.
Thanks much. So far I am very pleased with Digital Ocean!
Stephen
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Securing your Vue.js application and MariaDB database on a Digital Ocean droplet involves several steps, balancing security, manageability, and cost. Here are some strategies that align with your priorities:
Docker Compose: Use Docker Compose to manage your Vue.js and MariaDB services. Docker will help encapsulate your environment and dependencies, making it easier to move from development to production without significant changes.
Managed Database: Consider using Digital Ocean’s Managed Databases for MariaDB when you move to beta/production. This takes away much of the overhead of managing the database server.
HTTPS: Use Let’s Encrypt to obtain a free SSL certificate and ensure all communication is over HTTPS.
Firewall: Utilize Digital Ocean’s cloud firewalls to restrict access to your droplet. Only allow SSH (port 22), HTTP (port 80), and HTTPS (port 443).
SSH Keys: Use SSH keys instead of passwords for server login to reduce the risk of brute-force attacks.
Database Security: Ensure MariaDB is not accessible from outside your droplet. Use strong passwords and consider using database user privileges wisely.
Regular Updates: Keep your server’s software updated with the latest security patches. Enable unattended-upgrades for automatic security updates.
Backups: Use Digital Ocean’s backup service to regularly back up your droplet.
Nginx: Use Nginx as a reverse proxy for your Vue.js app. Nginx is efficient and can help with load balancing if you scale up later.
Caching: Implement caching strategies within your app to reduce database load.
Scale with Demand: Start with a small droplet and scale up as your needs grow. Monitor your usage and only scale when necessary.
Monitoring: Use Digital Ocean’s built-in monitoring tools to keep track of your droplet’s performance and adjust resources accordingly.
Deals & Credits: Look out for any promotions, credits, or referral programs Digital Ocean might offer to reduce costs.
Community & Tutorials: Utilize Digital Ocean’s extensive community tutorials to learn about deployment and DevOps.
Version Control: Use Git for version control and integrate your repository with CI/CD pipelines for automated testing and deployment.
Infrastructure as Code: Familiarize yourself with tools like Terraform to manage your infrastructure as code, which is beneficial for maintaining and scaling your application’s infrastructure.
Remember, security and performance are ongoing tasks. As you learn and your application grows, you’ll find more ways to improve and streamline your deployment process. Digital Ocean has an active community and plenty of resources, so make use of those as you progress through your development phases.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.