I Turned A Raspberry Pi Into A Node.js Web Server

Sdílet
Vložit
  • čas přidán 7. 06. 2024
  • I decided to grab a few raspberry pi's recently and have been wondering what projects I should do with these. This is the first of many projects I've decided to do. I ended up turning this first one into a Node.js web server. It also doubles as a file server for transfer files between devices on my network. This video shows the entire process of how I went about doing this.
    #RaspberryPi #Node.js #WebDev
    ⭐️ Interested in the kit I got? Below are affiliate links for the exact supplies I used:
    Raspberry Pi CanaKit: amzn.to/36Qpfgf
    3M Adhesives: amzn.to/36IWHFq
    👀 Follow Me:
    Twitter ➔ / portexe
    Instagram ➔ / port.exe
    GitHub ➔ github.com/portexe
    Facebook ➔ / portexe
    Website ➔ www.portexe.com/
    GAMING ➔ / portexe
    ---
    🎵 Music by Alexander Aultman. Show him some love!
    music.alexanderaultman.com
  • Zábava

Komentáře • 128

  • @KCMK123
    @KCMK123 Před 3 lety +65

    when dragging the files over to your pi os sd card you can simply add a ssh file thats empty and that will enable ssh on the pi. That will allow you to skip the whole hooking it up to your TV part.

  • @WebDevSimplified
    @WebDevSimplified Před 4 lety +113

    This was really interesting!

    • @gorgestboi1028
      @gorgestboi1028 Před 3 lety +2

      Web Dev Simplified oh hey. It’s you!

    • @mayank_upadhyay_19
      @mayank_upadhyay_19 Před 3 lety +2

      So, I got it, what you were doin when not uploading the videos ♥️

    • @bozhidarzhivkov2104
      @bozhidarzhivkov2104 Před 3 lety

      Yeah!

    • @kylermalachi9644
      @kylermalachi9644 Před 3 lety

      a tip: watch movies at Flixzone. Me and my gf have been using it for watching loads of movies during the lockdown.

    • @braylenraphael1999
      @braylenraphael1999 Před 3 lety

      @Kyler Malachi yup, been watching on Flixzone for years myself :)

  • @shreyasshivakumar8578
    @shreyasshivakumar8578 Před 3 lety +2

    Amazing! Just what I was looking for! Thank you so much

  • @Will-rm3ki
    @Will-rm3ki Před 3 lety

    This is awesome man thanks.

  • @MainlyWebStuff
    @MainlyWebStuff Před 2 lety

    Nice little video and good overview, thanks.

  • @DEV_XO
    @DEV_XO Před 4 lety +4

    Amazing mate, this is what I was looking for :)

  • @janidualahakoon4725
    @janidualahakoon4725 Před 2 lety

    great work man. keep it up..!

  • @matijasukovic7040
    @matijasukovic7040 Před 8 měsíci

    Thank you, very straightforward

  • @seanki
    @seanki Před 3 lety +1

    Nice video. The raspberry pi is so powerful

  • @Fullflexno
    @Fullflexno Před 4 lety +2

    Seriously man, this video was so dope🔥

  • @vladventura1928
    @vladventura1928 Před 3 lety +2

    Oh good stuff, actually what I was looking for. I'm planning to build something with a raspi 4, rgb strips and Flutter. Thank you! P.S: That file system is really cool as well... now you got me wondering if I should give this a shot in tandem with the rgb thing

  • @warrior16546
    @warrior16546 Před 4 lety +3

    Wow, what a high quality video! Nice work ensuring that the video and audio quality are top notch! It's exciting seeing what people are doing with the latest Raspberry Pi!
    Would you happen to know of any benchmarks for how Raspberry Pi 4B performs with number of requests on a
    Node server?

    • @mikolajwojnicki2169
      @mikolajwojnicki2169 Před 2 lety +2

      Probably depends on a bunch of factors such as the complexity of your server, your internet connection, if you use an SD card or an SSD for possible data storage, if you overclock your Pi and if you use the lite or desktop version of the OS. I am interested myself. I just started getting into web development so I'll probably test this in the future and maybe remember to reply :)

    • @mikolajwojnicki2169
      @mikolajwojnicki2169 Před 2 lety +1

      Well... I ended up spending the whole evening figuring this out.
      My conclusion is: for a simple "hello world" page it can handle up to about 600 requests a second.
      I have no idea what is a proper way to test this, I just tried sending a get request every couple miliseconds in a loop. Above 600 requests a second the response time often got long and it could even stop working.
      I used Express.js, the desktop version of the OS and did not overclock (regular 1.5 GHz RPi 4B)

  • @realmajed_
    @realmajed_ Před 3 lety

    Bro i was having issues updating Node... THANKS FOR THIS LOL

  • @pakistanigymers2k22
    @pakistanigymers2k22 Před 3 lety +1

    Thanks

  • @zlrivo
    @zlrivo Před 3 lety +3

    Oh my god thanks for showing the Remote SSH Plugin this is going to be so useful since I used to code on pi itself using nano ^^'

    • @unsound-methods
      @unsound-methods Před 3 lety +1

      dude you are hardcore :D

    • @zlrivo
      @zlrivo Před 3 lety

      @@unsound-methods yeah it's way better to code on vs code

    • @genkiferal7178
      @genkiferal7178 Před 2 lety

      micro is a terminal editor and has the common commands (ex: control+S for save) just like most editors. It should be able to completely replace nano, I think. I beleive you can also use it split screen (one half of the window for your PC and the other half for Pi - at same time). I am new to it.

    • @zlrivo
      @zlrivo Před 2 lety

      @@genkiferal7178 thanks for the fact

  • @kurdm1482
    @kurdm1482 Před 11 měsíci

    press `ctrl+J` to open console tab and do the JS check there, great video

  • @nightshocker6908
    @nightshocker6908 Před 2 lety

    great video. i looked up the droppy file server and the person whom made it is not working on it anymore with the last time being 2020. do you know of a good replacement that is still supported and is as simple and good like droppy?

  • @savashzaynal6502
    @savashzaynal6502 Před 3 lety

    Omg I was just looking at rpi proj but found out exactly what I want, which is a way to transfer media from my phone and store it in a file server which I can browse.

  • @harshithtunuguntla1861

    Which terminal are you using? I can see multiple terminals option...

  • @dfytq
    @dfytq Před 3 lety +1

    Cool video. Can you please let us know something about the installed nodejs web server's performance? I am planning to buy one pi to setup such server but I'm very confused thinking its performance, reliability's comparing to the paid hosting services. Also, webserver should running 24x7, so can this little boy do this for 24x7 continuously?

    • @PortEXE
      @PortEXE  Před 3 lety

      If you’re needing a production server where there will be users who need reliable speed and uptime, I would say don’t use the Pi, UNLESS you know what you’re doing.

  • @andres154525452
    @andres154525452 Před 3 lety +21

    Missed the full tutorial and some explanations for noobs like me...

  • @surbhigoel175
    @surbhigoel175 Před 7 měsíci

    I am not able to install node js in my rpi using the same commands as you did. Can you help me with the updated command for installing nvm?

  • @PwnKilla
    @PwnKilla Před 3 lety +1

    Silly question would you gain anything from implementing Kubernetes onto your RaspberryPi ? I'm trying to figure out what project to do and don't really understand what Kubernetes is for/ what is useful about it

    • @getzybaggins
      @getzybaggins Před 3 lety +1

      I suggest looking into docker, kubernetes is more for docker management

  • @MrWayneStephen
    @MrWayneStephen Před 4 lety

    Do you have a static up to access it publicly or is it just for local use

    • @PortEXE
      @PortEXE  Před 4 lety

      It’s only for local use right now

  • @pantojabenito3225
    @pantojabenito3225 Před 3 měsíci

    If i turn of the raspberry and then turn on the. This will launch the server automatically?

  • @LoveNX123
    @LoveNX123 Před 3 lety

    Nice video! How did you get your windows cmd to not suck and actually look appealing?

    • @PortEXE
      @PortEXE  Před 3 lety +1

      I am using the new Windows Terminal. It's not installed by default, but you can get it from the Microsoft Store. Takes a little bit of customization to get it to look good, but it's pretty straightforward.

    • @LoveNX123
      @LoveNX123 Před 3 lety

      @@PortEXE Thank you :)

  • @OmarGarcia-zx2yl
    @OmarGarcia-zx2yl Před 4 lety +1

    So here I am having no idea what this genius is doing

    • @CharleyCheno
      @CharleyCheno Před 3 lety

      same

    • @unrealbot3027
      @unrealbot3027 Před 3 lety

      He just created a personal server where he stores data about his webpage(s) which users can access by requesting. For example - suppose his website xyz.com is a music downloading page. He stores all the actual music files in his raspberry Pi server and keep it switched on all the time for the server to function. You visit xyz.com and request to download a music file , your browser requests his raspberry Pi to let you download the requested file.

  • @uasutakasaona4920
    @uasutakasaona4920 Před 2 lety

    Is this the same project as using a web interface for your Raspberry Pi?

  • @letsgetto1millwithoutvids

    How to make it host a live server and display it on a screen from a pi. Just as iF I would use GitHub pages and use the pi to access the page and display it on a screen how would I host it and access display it on a screen from the pi. I don't need anything else to access the site. The site will have html files, Js files and css files

  • @supremegangcertifiedleader3916

    How do I host a website tho? and giving it a domain name?

  • @kevinmartinez55
    @kevinmartinez55 Před 3 lety

    Is it possible for you to change the web address?

  • @jeff6555
    @jeff6555 Před 20 dny

    It's such a strange thing for me to get hung up on, but you really should have trimmed the other end of that command strip. The tab you snipped was for removal :)

  • @lordsqueeb7827
    @lordsqueeb7827 Před 3 lety

    best way to serve this?

  • @jimreiter2648
    @jimreiter2648 Před 3 lety +1

    Square pin is indeed pin 1...industry standard....

  • @rohitchowdhary618
    @rohitchowdhary618 Před 2 lety

    Which cmd r u using

  • @SamiKhan-sb5ik
    @SamiKhan-sb5ik Před 2 lety

    Advantages of own server???

  • @adityaramesh1764
    @adityaramesh1764 Před 3 lety +2

    This is cool! What would you use a web server for?

    • @soulninjadev
      @soulninjadev Před 3 lety

      backend for a website, API etc

    • @genkiferal7178
      @genkiferal7178 Před 2 lety

      your own VPN, your own cloud service such as NextCloud, your own media (I want mine for music), your own web site....

  • @HardcoreNacho
    @HardcoreNacho Před 3 lety +1

    You do realize the tabs you cut off are what is used to remove the sticky part later right?

    • @PortEXE
      @PortEXE  Před 3 lety

      Yes, that was intentional.

  • @abhijeet800
    @abhijeet800 Před 3 lety

    thanks bro i do not know what I am doing but it worked thanks.

  • @sumitsinghdeode2138
    @sumitsinghdeode2138 Před 3 lety

    Can I acess it over internet?

  • @thenetanel1996
    @thenetanel1996 Před 2 lety

    how fast are the responses?

  • @anirbandas12
    @anirbandas12 Před 4 lety +1

    why not use Noobs Lite and Raspbian Lite when ur going 2 use SSH to control ur pi?

    • @PortEXE
      @PortEXE  Před 4 lety +1

      I actually plan to use it for all sorts of purposes

  • @aaomms7986
    @aaomms7986 Před 2 lety

    i've some question about Droppy account how can i create Droppy account?

  • @abduljamac
    @abduljamac Před 4 lety +1

    Are you required to leave the raspberry pi on all the time or can you turn of the power when your not using it?

    • @PortEXE
      @PortEXE  Před 4 lety +2

      You can turn off the power when you're not using. It's suggested to set up your Node server and/or file server to boot automatically with the OS so that it's truly "Plug and play".

    • @abduljamac
      @abduljamac Před 4 lety +1

      @@PortEXE what do you mean boot automatically?

    • @PortEXE
      @PortEXE  Před 4 lety +1

      You can write a bash script that will boot the server up automatically when the device powers on. If you ever need help with that, feel free to reach out to me when the time comes.

    • @abduljamac
      @abduljamac Před 4 lety +1

      @@PortEXE will do thank you

    • @yt-sh
      @yt-sh Před 4 lety +2

      @@PortEXE you should make more useful video like this!!

  • @younesidsouguou7287
    @younesidsouguou7287 Před 3 lety

    That's a great showcase of the RPi 4 features, except for the limited storage on the SD card. Which hints sticking some extrenal USB 3.0 hard drive next to it.

    • @PortEXE
      @PortEXE  Před 3 lety +2

      Yeah without an external drive it wouldn't be recommended to use as a file storage server, but it would work fine for a web server for serving web sites.

  • @gamerneversleep4200
    @gamerneversleep4200 Před 3 lety +2

    idk why u install raspberry pi desktop when u r just going to use ssh.

  • @jundilab1695
    @jundilab1695 Před rokem

    It's great tutorial but, how to add the domain name

  • @marcelkrause5293
    @marcelkrause5293 Před 2 lety

    You have a huge command center but don't know how to setup a raspberry pi without monitor and keyboard attached?
    One can do all the config with config-files on your sd-card.

  • @karandidwani
    @karandidwani Před 4 lety

    But this will only work on your local network
    Its no way connected to the outside of the world right?
    When you would be in your home network you can use this as a web server
    But it doesnt solve any purpose if the "web" server is not open to the internet

    • @PortEXE
      @PortEXE  Před 4 lety

      You’d just need to do some configuration to open it to outer networks. I plan to mainly use this web server for development on my local network.

    • @this.channel
      @this.channel Před 4 lety +3

      You will need to open a port (usually 80) on the router to make it a web server. Be careful though, you need to secure the pi first. Here is a good starter www.raspberrypi.org/documentation/configuration/security.md
      You might want a dynamic dns service too, if you don't have a static public ip address. There are free and paid ones. Modern router admin usually had settings to configure them, but if not, you can use something like ddclient.

    • @joostschuur
      @joostschuur Před 4 lety

      If you just need to temporarily share a site you're working on with someone and don't want to change your router config, you could also use ngrok or localtunnel. If you're using their free tier, the URL would just change every time you start it up.

  • @tristanzaleski4583
    @tristanzaleski4583 Před 2 lety

    Me looking down at my megaminx... Me looking around at my monitors and LED lit desktop setup... Me looking at my systems domain name, while you refer to your setup as 'the Lair'... WHO ARE YOU AND WHY ARE YOU IN MY HEAD?!?!?!

  • @WesleyFranks
    @WesleyFranks Před 3 lety

    Why no hard line? No RJ45? No Ethernet cable?

    • @deepneon5414
      @deepneon5414 Před 3 lety

      heard of WiFi?

    • @genkiferal7178
      @genkiferal7178 Před 2 lety

      that is also my concern, but maybe since he only uses the Pi at home, he doesn't need that? I am looking for a new room to rent and am worried about the whole Ethernet cable issue since I hope to learn to use the pi server outside of the home and maybe even put a small website up.

  • @ThunderstruckElectronix

    3:00 why did he do whatever he did there?

    • @PortEXE
      @PortEXE  Před 3 lety +1

      It’s to check and make sure that the file hasn’t been modified by a nefarious 3rd party. Hackers can be clever, so checking the hashes is always a good thing to do.

    • @ThunderstruckElectronix
      @ThunderstruckElectronix Před 3 lety +1

      @@PortEXE ok cool. Ty for answering 👍

  • @lemonbibu8990
    @lemonbibu8990 Před 3 lety

    Would that just be like a Google drive

    • @Adi-ss9vn
      @Adi-ss9vn Před 3 lety

      It will have more functions than GDrive. Forwarding the port will make it accessible from anywhere in the world.

  • @TungVu-jm1eo
    @TungVu-jm1eo Před 3 lety

    Can we put this website online?

    • @PortEXE
      @PortEXE  Před 3 lety

      Yes although it would require further configuration.

  • @narcissisticnarcissus4956

    How to host my own domain on this server?

    • @aleph7024
      @aleph7024 Před 3 lety +1

      In case you have a static ip address, you should use your modem DMZ option, add MX zones to your raspberry pi and also your own DNS, using cloudflare will make it easier for you to do so.
      DDNS would be another option which is not 100% errorless.

    • @CharleyCheno
      @CharleyCheno Před 3 lety

      How to host my own domain on this server?

    • @aleph7024
      @aleph7024 Před 3 lety

      @@CharleyCheno just replied the same question in the above reply, 2 months ago :)

    • @Someone-ju7sx
      @Someone-ju7sx Před 3 lety +1

      How to host my own domain on this server?

    • @aleph7024
      @aleph7024 Před 3 lety

      @@Someone-ju7sx lol

  • @ilearncode7365
    @ilearncode7365 Před 3 lety

    But muh "Oh noes, they will do hax if you open port 80!!!"

  • @narcissisticnarcissus4956

    Not really a tutorial unfortunately.
    Could you make a quick step by step tutorial, please?

    • @PortEXE
      @PortEXE  Před 3 lety +1

      This was just a fun little project I did. I have no plans on making a tutorial for this project. Perhaps in the future I may do something similar however.

  • @Dogeater300
    @Dogeater300 Před 3 lety

    How much file can the server hold? As much as the SD card?

    • @PortEXE
      @PortEXE  Před 3 lety

      Yes as long as that’s how you’re Linux file system is set up. Which it should be by default.

    • @kingofthepod5169
      @kingofthepod5169 Před 3 lety

      There was a mod for the pi 3 where you flash an update to it to boot from USB (& Ethernet). I did that and I got it running from a flashdrive .

    • @genkiferal7178
      @genkiferal7178 Před 2 lety

      @@kingofthepod5169 ? you mean your booted into a live USB OS like you can on a PC? I am new and learning. DOn't want to make costly mistakes and buy the wrong thing(s).

  • @AlexWayne97
    @AlexWayne97 Před 3 lety

    No entendí

  • @liammorrison4284
    @liammorrison4284 Před 2 lety

    Awesome content, but that intro beat is whack

  • @Tyrone-Ward
    @Tyrone-Ward Před 2 lety

    Where was the Node.js server tutorial? You spent 5 minutes setting up the Raspberry Pi and about 30 seconds not showing us how to do anything in Node.js,

    • @PortEXE
      @PortEXE  Před 2 lety

      This was not a tutorial. It was just a fun project that I took on and decided to document.

  • @elozm7962
    @elozm7962 Před 2 lety +1

    pleas look normel at the camera look scary just look tho the resberry pi thats les scary than you keep loking at the camera

  • @MedyGames
    @MedyGames Před 4 lety +2

    I never found a good enough reason so far to get a pie ...
    Since Everything can be installed and run on my pc...
    Lets be honest here .. the pc is mostly running anyway ..
    So why use a second device that has little to no purpouse ....
    Especially with other options like dropbox .... gdrive etc .....
    which can serve as a bridge with zero cost or installation ...

    • @MedyGames
      @MedyGames Před 4 lety +1

      that being said ... I wiill probably give in one day and solve some problems that don't exits as well.. to get some linux / cmd exposure..
      Even talking to friends that own a pie ... their only reason seems to being free of "the cloud" ... and to fiddle togehter stuff for fun and for the sake of fiddling xD...
      which is a good honest reason ;) ....

    • @PortEXE
      @PortEXE  Před 4 lety +1

      I'd say portability of it is another thing to look at. You could even set it up to work with a network coming from your phone if you have a hotspot capable phone. At that point you have a portable web server on a portable network. I'd research web security first though if anyone ends up being interested in that idea.

    • @MedyGames
      @MedyGames Před 4 lety +1

      you dont need a rasperry / node js to create a fileserver from your phone.... there are phone apps for that .... so you could acces your phone directly from your pc ....
      that way you dont need a webserver either to upload things xD
      as I said ... solving problems that dont exists

    • @PortEXE
      @PortEXE  Před 4 lety +3

      Oof. Okay 👍

    • @MedyGames
      @MedyGames Před 4 lety

      @@PortEXE I dont wanna sound discouraging xD ...
      Its just that when I think of getting a pie ... I cant lie to myself that the idea I want to set up ... can totally be solved in another way .. which most of the time make a solution involving a pie totally a waste of time xD...
      Though if you find yourself smth that you cant achieve otherwise ...
      I would be the first to jump on a pie in a hearttbeat xD ...
      I may be an oddball ... as im even running iobroker on my pc ... xD .. in a sense .. nothing is happening when my pc is not on anyway .. maybe that is different for you .. or maybe you just wanted a pie and created a solutuion that is not neccecary^^

  • @markspc1
    @markspc1 Před 3 lety

    No security at all; hacker's playground !

    • @PortEXE
      @PortEXE  Před 3 lety

      This is a local development server. It’s not open to the outside.

  • @christophhandschuh6304
    @christophhandschuh6304 Před 2 lety +1

    I built a Mini Server with a Raspberry Pi Zero. It has an 1.3" Oled Display and an Rotory Encoder. I also wrote a Python script which displays the current stats(CPU, Disk...) and there is also a menu where you can go throw all the files and start NodeJs scripts. You can have a look here: www.thingiverse.com/thing:4935803