Deploy A Static Website Using The Linode CLI | Object Storage Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello this is super user my name is i'm a developer advocate for lenode and in this video i'm going to introduce you to object storage in a previous video we talked about databases the different types of databases and what each one is optimal for databases are great when we want to store data that needs some kind of structure or needs to be updated frequently however not all the data in our application will actually need to be updated at all so let's say we want to store images for every product in our online store or we want to store pdf receipt for every purchase our users make it may seem intuitive to store this data in our database or the server our application is running on however as our application scales these solutions start becoming inefficient this will slow down our database and make our entire application slow a good solution for storing static data in our application is object storage how object storage works is actually quite similar to the file storage system in our local machines we have an object storage system and we store our data in this object storage system we then expose each individual data as individual objects in order for us to be able to add new data update the data or view the data we then use api requests we can also optionally add a unique url to help us identify each data in our object storage system so in the case of storing images we would actually store all the images in an object storage system inside a folder called images so in the case of our application we would use these unique urls to help us identify each image that belongs to a specific product we then store the url that belongs to that image in a database we can already see that this will relieve a huge lift from our database or our server depending on where we're initially storing the data this means that as new products get edit in the images of those products don't actually speed down our application it also means that as the quality of images in our application improve it doesn't necessarily make a difference to the efficiency and speed of our database now there are many uses for object storage it's not just limited to images or pdf files you can store media files youtube files youtube videos that you've been working on you can store your excel documents backups of your essay you can literally store any type of data in object storage my personal favorite use for object storage is to deploy static websites setup websites are simply just files you view on the browser and where do we store files our favorite place for storing files is object storage so we can actually store html files and make them publicly accessible and this will be our first simple application i'm going to now show you how to deploy your first static site on the node object storage system in a matter of a few minutes i'm at my desktop and i'm going to show you how to deploy your first static file on the lynnode platform the first thing you're going to need to do is follow the link in the description below to take you to the node website and in this website you'll actually get a voucher so that's pretty cool so remember to click the link in the description below to take you to the node website i've already got my account so i'm just going to log in but if it's your first time remember to just hit the sign up button and after logging in i've already told it to remember my machine so it's just going to take me to cloud.node.com and this is the cloud manager where i'll be able to access all of the nodes products currently we are looking for object storage so i'm just going to go on the product list just click on object storage and it will take me to the object storage view and here it's going to actually have a button that just simply asks me to add a bucket and i'm just going to add a bucket and a bucket is what is the actual object storage that i'll be using to store my data and i'm going to call this bucket static website the region i'm going to choose is newark um you can just choose a region that's closer to you it doesn't always make a huge difference and then i'm going to click on submit and it's actually going to create my bucket for me which is pretty awesome but my bucket is still empty so i need to actually add files these are the files that will actually make my website and to do that i've already gone ahead and i have created a couple of files and put them in my computer i've created an index.html which is the actual html file so i'm styling for it under my styles.css and the image that i actually also want to use to make my website a little bit pretty so we've got the files that we actually want to deploy and now what i'm going to do is i'm going to take these files and i'm going to actually add them to my bucket and then i'm going to so i'm going to browse files and then after clicking on browse files there are my files index.ph.d index.html and styles.css and i'm going to open that and it's going to upload all my files to the bucket which is pretty awesome so just like that i've actually created a bucket with files in it and what i want to show is my index.html i'm gonna go to click on the kebab and then details and now i can click on the actual link it's created a link for me and there it is the big access denied the reason for this is because for security reasons everything in our buckets by default as private because we don't always want to share the information we store in our buckets sometimes you want to store sensitive information however this is a publicly accessible website and we do want people to be actually able to view our site so what we are then going to do is we're going to actually make these files publicly accessible we can't do this on the cloud manager as of yet so we're going to do it on the terminal which is going to be super fun i'm going to show you how to do it and the first thing we're going to need to do is to actually open up a terminal we've got a fresh new one over here first thing i'm going to need to install is i'm going to need to install the node cli which is the node command line interface which will allow me to run uh le node commands as if i'm actually on the dashboard and the second thing we're going to need to do is to install boto boto is the package that will allow us to manipulate buckets on the command line so then we're going to go pip 3 install the node cli if you do struggle with some of the commands and you maybe don't really know which command works for what here's a quick pro tip i just like to go to lenode documentation and they have written some incredibly amazing documentation for all their products and it's very user friendly and i really enjoyed it like for this tutorial to prepare i used documentation from this so this is really awesome like congrats to the nerd team on velvet and documentation now i'm going to just go back to my terminal i've now installed the node cli just like that was quite easy and the next thing we're going to need is boto so pip3 install photo okay cool awesome now we've installed boto so we've got photo now so we've got to the cli and we've got boto which means that we can do stuff on lenode and we can manipulate buckets on our terminal next command we're going to need to run is configure node because we want lenod on the web to know that the node that is in this terminal is sunshine in my code and then for that we're going to type the node cli config and what will it will ask me is to insert a personal access token and it's actually really helpful in that it also gives me the link to go to follow if i do want to access my personal access token and then i'm just gonna copy this link and paste it on the new new window and then enter there we go and now it's actually just taking me straight to that view you can just use that link or if you want to know how to do it from you know let's say we're viewing buckets and you want to know how to do it you just click on your profile and my click on my profile and you'll see a few options to edit your profile and we are looking for is an api token and this will take you to that link that they shared with us on the terminal and then i'm gonna add a personal access token i'm gonna call this token my linux machine and it will expire in six months i'm cool with that and this then you get to choose the product you want access for we want for object storage and we want to be able to read or write because we are going to be changing the access rights for our object storage also you don't just have to choose object storage you want to open yourself to be able to explore all the products so i'm just going to click on select all and then i'm going to create a token then it's going to give me a token which is a password essentially so you don't want to share this token with anyone and once you click on ok you won't be able to see the token again so you want to make sure that you store it in a safe place you can store it in lastpass that's a good option and then i'm going to go back to my terminal and i'm going to enter this token over here i'm going to paste my token over here and now it says configuring for sunshine in my code which means the node on my terminal and then a node on my web know who i'm talking to and then it's gonna ask me to choose a region right when it comes to choosing a region i prefer to just okay i'm going to click on okay and close this view and then i'll go to object storage and i'll just look at the region i use to create a product so i've got us east one over here so i'm just gonna go back to my terminal and yeah choose us east which is option six enter and then it's gonna ask me for some other stuff that's related to linux i'm going to enter enter because it's all optional now the next thing you want to do now is that we've got ourselves configured which is essentially we've logged into the terminal as the user on the web now i'm going to type the first command which is the node cli obj which is the object storage product and then i'm going to type la which will list my buckets and the the data in my buckets which is pretty awesome if you do again get lost with the command remember to check out the documentation on the cli on all the products really helpful ah now it's saying era no default cluster is configured and my options are used one and i'm going to choose that one because that is the cluster i'm using for my buckets and i'm gonna choose option one enter and now what it's actually telling me which is pretty awesome is that it has written a config file to this url so i can actually view my config file such as ctrl shift tab so open a new tab on the terminal and i can just cat and then paste that url that it's given me over here enter and i can actually see my config details so if you ever have security issues just remember to check this file and you can maybe manually update your token and your access keys and change your region if you would like but for now we just want to make these three files publicly accessible so the command for that is the node dash cl i o h o p j which is the object storage and i want to set the acl for each of these files and i'm going to dash dash acl public public which means i want them to be publicly accessible and then the next command the next word is the name of the object storage so i'm gonna it's called static website followed and by the name of the file the first file i'm gonna go for is index.html because that's just how they appear over here and then it's gonna say acl updated which means that it's successfully made this file publicly accessible i can then do the same thing for index.png awesome this is going well and then the next the last file is styles.css so it really helps to do that initial object la which will actually allow me to see all the files and i can see that this is what i need to update and now i can go back to my browser and refresh this link so this should now be publicly accessible which is great you see my images there and the file is there and it's got some pretty cool stuff and just for bonus it's got a link to the object storage style guide and now i'm actually gonna go back to my cloud manager and i want to now view that image i made publicly accessible and i'm gonna click on details click on this so this is the added bonus which is that you can actually also use this to publicly um share your images so if you want to share an image with people on the internet this is a really cool way to just be able to allow those people to see them it's really great for file sharing with anyone and that is it that is how easy it is to deploy your first tactic website on the node platform i do hope that you enjoyed this video and if you did remember to give it a thumbs up and also subscribe to this channel so that you can continue seeing more amazing content from us from myself so and the lenode team will see you in the next video [Music] you
Info
Channel: Linode
Views: 2,488
Rating: undefined out of 5
Keywords: linode, linux, object storage, linode object storage, static site, static site object storage, cloud computing, cloud hosting, static website, linode cli, s3, s3 static site, host static site s3, linode tutorial, linux static site, linode s3, linode s3 object storage, static site upload, linode cloud manager, linode storage, linode vps, linode server setup
Id: ZfGyeJ8jYxI
Channel Id: undefined
Length: 15min 12sec (912 seconds)
Published: Fri Dec 11 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.