{"componentChunkName":"component---src-templates-blog-tsx","path":"/blog/vps-backup-solution-using-aws-s3","result":{"data":{"background":null,"article":{"htmlAst":{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"p","properties":{"className":["lead"]},"children":[{"type":"text","value":"\nThe in-house solution from your cheap hosting provider is gonna be expensive... you have to look elsewhere.\n"}]},{"type":"comment","value":" end "},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"When you get cheap hosting, all the other services around tend to be more expensive... just to balance the price out. Or they might be some unnecessary restrictions. But there is a way, you can always go with an external provider."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Although, there are many options out there, I think AWS S3 is quite cheap as a backup solution for your VPS. And one thing you do need from a backup is reliability, which there is no doubt if AWS has it."}]},{"type":"element","tagName":"h2","properties":{"id":"what-is-a-backup-and-is-it-necessary","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#what-is-a-backup-and-is-it-necessary","ariaLabel":"what is a backup and is it necessary permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"What is a backup and is it necessary?"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"While this question might be unnecessary, the backup is definitely not. Anyway, there is no magic behind backup, it is a plain old copy of data."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"And AWS S3 is just a storage for data. The good thing is... "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"you pay only for what you use"}]},{"type":"text","value":"."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"In the case of backup, the majority of the time (maybe forever if you are lucky) you will only write data and keep them at rest"}]},{"type":"text","value":". You also need your data to be secure, so nobody can access them without permission. S3 has all of that... your data can be encrypted and you can manage permissions for accessing it."}]},{"type":"element","tagName":"h2","properties":{"id":"pricing","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#pricing","ariaLabel":"pricing permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Pricing"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The pricing of "},{"type":"element","tagName":"a","properties":{"href":"https://aws.amazon.com/s3/pricing/","target":"_blank","rel":["nofollow","noopener","noreferrer"]},"children":[{"type":"text","value":"AWS"}]},{"type":"text","value":" at the time I am writing this is "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"$0.0135 per GB / month for Infrequent Access storage class"}]},{"type":"text","value":". You can even push the price as low as $0.0045 per GB / month if you go with Glacier, but there are some nasty limitations I don't want to get into right now."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You pay $0.01 for every 1,000 write requests you initiate... so if you are not planning to backup your data every second, you should be fine."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Then you also pay a small fee for the read requests and data transfer from S3. However, this should be only in the case of recovery, thus basically for free."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"It also worth checking "},{"type":"element","tagName":"a","properties":{"href":"https://aws.amazon.com/free/","target":"_blank","rel":["nofollow","noopener","noreferrer"]},"children":[{"type":"text","value":"AWS Free Tier"}]},{"type":"text","value":"."}]},{"type":"element","tagName":"h3","properties":{"id":"example","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#example","ariaLabel":"example permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Example"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Let's consider you do a daily backup of 10GB of data. You will pay around $0.1 per month (cost of storage + write requests)."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"I used "},{"type":"element","tagName":"a","properties":{"href":"https://calculator.s3.amazonaws.com/index.html","target":"_blank","rel":["nofollow","noopener","noreferrer"]},"children":[{"type":"text","value":"AWS Pricing Calculator"}]},{"type":"text","value":" to do the heavy math for me. "}]},{"type":"element","tagName":"h2","properties":{"id":"the-code","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#the-code","ariaLabel":"the code permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"The code"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Unlike a ready-made solution from the hosting provider, you need some code to do the backup."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If you are using "},{"type":"element","tagName":"a","properties":{"href":"https://www.docker.com/","target":"_blank","rel":["nofollow","noopener","noreferrer"]},"children":[{"type":"text","value":"Docker"}]},{"type":"text","value":", you can check my backup solutions below... if you are not, you can still check them and change them accordingly."}]},{"type":"element","tagName":"h4","properties":{"id":"backup-solutions-inside-docker","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#backup-solutions-inside-docker","ariaLabel":"backup solutions inside docker permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Backup solutions inside Docker"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://github.com/drahoslavzan/mariadb-backup-s3","target":"_blank","rel":["nofollow","noopener","noreferrer"]},"children":[{"type":"text","value":"MariaDB"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://github.com/drahoslavzan/mongodb-backup-s3","target":"_blank","rel":["nofollow","noopener","noreferrer"]},"children":[{"type":"text","value":"MongoDB"}]}]},{"type":"text","value":"\n"}]}]},"frontmatter":{"date":"September 13, 2020","slug":"vps-backup-solution-using-aws-s3","title":"Nearly FREE backup solution for your VPS using AWS S3","description":"Almost free VPS backup using AWS S3","tags":["backup","VPS","AWS","Docker"],"prev":"cheap-vps-hosting-comparison-digitalocean-vs-contabo"}},"prev":{"frontmatter":{"slug":"cheap-vps-hosting-comparison-digitalocean-vs-contabo","title":"Why I moved my VPS from Digital Ocean to Contabo"}},"next":null},"pageContext":{"slug":"vps-backup-solution-using-aws-s3","prev":"cheap-vps-hosting-comparison-digitalocean-vs-contabo","ps":"

P.S. I'm on Twitter, follow me if you'd like to get notified when I make a new post. Or send me a DM if you want to get in touch.

","heroPath":null}},"staticQueryHashes":["1034533238","3915966880","4035033399"]}