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

  Переглядів 108,823

PortEXE

PortEXE

День тому

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

КОМЕНТАРІ: 127
@KCMK123
@KCMK123 3 роки тому
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.
@ordoabchao2495
@ordoabchao2495 2 роки тому
Very good point brother
@TheJackTheLion
@TheJackTheLion 9 місяців тому
This is what I did, much easier.
@shreyasshivakumar8578
@shreyasshivakumar8578 3 роки тому
Amazing! Just what I was looking for! Thank you so much
@WebDevSimplified
@WebDevSimplified 3 роки тому
This was really interesting!
@gorgestboi1028
@gorgestboi1028 3 роки тому
Web Dev Simplified oh hey. It’s you!
@mayank_upadhyay_19
@mayank_upadhyay_19 3 роки тому
So, I got it, what you were doin when not uploading the videos ♥️
@bozhidarzhivkov2104
@bozhidarzhivkov2104 2 роки тому
Yeah!
@kylermalachi9644
@kylermalachi9644 2 роки тому
a tip: watch movies at Flixzone. Me and my gf have been using it for watching loads of movies during the lockdown.
@braylenraphael1999
@braylenraphael1999 2 роки тому
@Kyler Malachi yup, been watching on Flixzone for years myself :)
@matijasukovic7040
@matijasukovic7040 7 місяців тому
Thank you, very straightforward
@Will-rm3ki
@Will-rm3ki 3 роки тому
This is awesome man thanks.
@janidualahakoon4725
@janidualahakoon4725 Рік тому
great work man. keep it up..!
@MainlyWebStuff
@MainlyWebStuff 2 роки тому
Nice little video and good overview, thanks.
@seanki
@seanki 3 роки тому
Nice video. The raspberry pi is so powerful
@vladventura1928
@vladventura1928 3 роки тому
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
@DEV_XO
@DEV_XO 3 роки тому
Amazing mate, this is what I was looking for :)
@pakistanigymers2k22
@pakistanigymers2k22 3 роки тому
Thanks
@Fullflexno
@Fullflexno 3 роки тому
Seriously man, this video was so dope🔥
@kurdm1482
@kurdm1482 10 місяців тому
press `ctrl+J` to open console tab and do the JS check there, great video
@therealmajed
@therealmajed 2 роки тому
Bro i was having issues updating Node... THANKS FOR THIS LOL
@warrior16546
@warrior16546 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 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 2 роки тому
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)
@nightshocker6908
@nightshocker6908 2 роки тому
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 3 роки тому
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
@harshithtunuguntla1861 2 роки тому
Which terminal are you using? I can see multiple terminals option...
@zlrivo
@zlrivo 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 3 роки тому
dude you are hardcore :D
@zlrivo
@zlrivo 3 роки тому
@@unsound-methods yeah it's way better to code on vs code
@genkiferal7178
@genkiferal7178 2 роки тому
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 2 роки тому
@@genkiferal7178 thanks for the fact
@MrWayneStephen
@MrWayneStephen 3 роки тому
Do you have a static up to access it publicly or is it just for local use
@PortEXE
@PortEXE 3 роки тому
It’s only for local use right now
@PwnKilla
@PwnKilla 3 роки тому
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 3 роки тому
I suggest looking into docker, kubernetes is more for docker management
@andres154525452
@andres154525452 3 роки тому
Missed the full tutorial and some explanations for noobs like me...
@pantojabenito3225
@pantojabenito3225 Місяць тому
If i turn of the raspberry and then turn on the. This will launch the server automatically?
@surbhigoel175
@surbhigoel175 6 місяців тому
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?
@lordsqueeb7827
@lordsqueeb7827 3 роки тому
best way to serve this?
@dfytq
@dfytq 3 роки тому
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 3 роки тому
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.
@rohitchowdhary618
@rohitchowdhary618 2 роки тому
Which cmd r u using
@uasutakasaona4920
@uasutakasaona4920 2 роки тому
Is this the same project as using a web interface for your Raspberry Pi?
@letsgetto1millwithoutvids
@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
@supremegangcertifiedleader3916 3 роки тому
How do I host a website tho? and giving it a domain name?
@kevinmartinez55
@kevinmartinez55 3 роки тому
Is it possible for you to change the web address?
@sumitsinghdeode2138
@sumitsinghdeode2138 3 роки тому
Can I acess it over internet?
@abduljamac
@abduljamac 3 роки тому
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 3 роки тому
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 3 роки тому
@@PortEXE what do you mean boot automatically?
@PortEXE
@PortEXE 3 роки тому
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 3 роки тому
@@PortEXE will do thank you
@yt-sh
@yt-sh 3 роки тому
@@PortEXE you should make more useful video like this!!
@aaomms7986
@aaomms7986 2 роки тому
i've some question about Droppy account how can i create Droppy account?
@SamiKhan-sb5ik
@SamiKhan-sb5ik 2 роки тому
Advantages of own server???
@LoveNX123
@LoveNX123 3 роки тому
Nice video! How did you get your windows cmd to not suck and actually look appealing?
@PortEXE
@PortEXE 3 роки тому
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 3 роки тому
@@PortEXE Thank you :)
@thenetanel1996
@thenetanel1996 2 роки тому
how fast are the responses?
@anirbandas12
@anirbandas12 3 роки тому
why not use Noobs Lite and Raspbian Lite when ur going 2 use SSH to control ur pi?
@PortEXE
@PortEXE 3 роки тому
I actually plan to use it for all sorts of purposes
@HardcoreNacho
@HardcoreNacho 3 роки тому
You do realize the tabs you cut off are what is used to remove the sticky part later right?
@PortEXE
@PortEXE 3 роки тому
Yes, that was intentional.
@adityaramesh1764
@adityaramesh1764 3 роки тому
This is cool! What would you use a web server for?
@soulninjadev
@soulninjadev 2 роки тому
backend for a website, API etc
@genkiferal7178
@genkiferal7178 2 роки тому
your own VPN, your own cloud service such as NextCloud, your own media (I want mine for music), your own web site....
@OmarGarcia-zx2yl
@OmarGarcia-zx2yl 3 роки тому
So here I am having no idea what this genius is doing
@CharleyCheno
@CharleyCheno 3 роки тому
same
@unrealbot3027
@unrealbot3027 3 роки тому
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.
@jimreiter2648
@jimreiter2648 3 роки тому
Square pin is indeed pin 1...industry standard....
@karandidwani
@karandidwani 3 роки тому
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 3 роки тому
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 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 3 роки тому
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.
@jundilab1695
@jundilab1695 Рік тому
It's great tutorial but, how to add the domain name
@gamerneversleep4200
@gamerneversleep4200 3 роки тому
idk why u install raspberry pi desktop when u r just going to use ssh.
@abhijeet800
@abhijeet800 3 роки тому
thanks bro i do not know what I am doing but it worked thanks.
@narcissisticnarcissus4956
@narcissisticnarcissus4956 3 роки тому
How to host my own domain on this server?
@aleph7024
@aleph7024 3 роки тому
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 3 роки тому
How to host my own domain on this server?
@aleph7024
@aleph7024 3 роки тому
@@CharleyCheno just replied the same question in the above reply, 2 months ago :)
@Someone-ju7sx
@Someone-ju7sx 3 роки тому
How to host my own domain on this server?
@aleph7024
@aleph7024 3 роки тому
@@Someone-ju7sx lol
@WesleyFranks
@WesleyFranks 3 роки тому
Why no hard line? No RJ45? No Ethernet cable?
@deepneon5414
@deepneon5414 3 роки тому
heard of WiFi?
@genkiferal7178
@genkiferal7178 2 роки тому
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.
@marcelkrause5293
@marcelkrause5293 2 роки тому
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.
@TungVu-jm1eo
@TungVu-jm1eo 3 роки тому
Can we put this website online?
@PortEXE
@PortEXE 3 роки тому
Yes although it would require further configuration.
@ThunderstruckElectronix
@ThunderstruckElectronix 3 роки тому
3:00 why did he do whatever he did there?
@PortEXE
@PortEXE 3 роки тому
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 3 роки тому
@@PortEXE ok cool. Ty for answering 👍
@younesidsouguou7287
@younesidsouguou7287 3 роки тому
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 3 роки тому
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.
@Dogeater300
@Dogeater300 3 роки тому
How much file can the server hold? As much as the SD card?
@PortEXE
@PortEXE 3 роки тому
Yes as long as that’s how you’re Linux file system is set up. Which it should be by default.
@kingofthepod5169
@kingofthepod5169 2 роки тому
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 2 роки тому
@@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).
@tristanzaleski4583
@tristanzaleski4583 2 роки тому
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?!?!?!
@lemonbibu8990
@lemonbibu8990 3 роки тому
Would that just be like a Google drive
@Adi-ss9vn
@Adi-ss9vn 3 роки тому
It will have more functions than GDrive. Forwarding the port will make it accessible from anywhere in the world.
@narcissisticnarcissus4956
@narcissisticnarcissus4956 3 роки тому
Not really a tutorial unfortunately. Could you make a quick step by step tutorial, please?
@PortEXE
@PortEXE 3 роки тому
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.
@AlexWayne97
@AlexWayne97 3 роки тому
No entendí
@liammorrison4284
@liammorrison4284 2 роки тому
Awesome content, but that intro beat is whack
@ilearncode7365
@ilearncode7365 2 роки тому
But muh "Oh noes, they will do hax if you open port 80!!!"
@PortEXE
@PortEXE 2 роки тому
😂
@Tyrone-Ward
@Tyrone-Ward Рік тому
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 Рік тому
This was not a tutorial. It was just a fun project that I took on and decided to document.
@MedyGames
@MedyGames 3 роки тому
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 3 роки тому
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 3 роки тому
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 3 роки тому
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 3 роки тому
Oof. Okay 👍
@MedyGames
@MedyGames 3 роки тому
@@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^^
@elozm7962
@elozm7962 2 роки тому
pleas look normel at the camera look scary just look tho the resberry pi thats les scary than you keep loking at the camera
@markspc1
@markspc1 3 роки тому
No security at all; hacker's playground !
@PortEXE
@PortEXE 3 роки тому
This is a local development server. It’s not open to the outside.
@christophhandschuh6304
@christophhandschuh6304 2 роки тому
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
the Raspberry Pi 5
17:57
NetworkChuck
Переглядів 1 млн
I Spy, with my Little Pi...
23:46
Jeff Geerling
Переглядів 232 тис.
[실시간] 전철에서 찍힌 기생생물 감염 장면 | 기생수: 더 그레이
00:15
Netflix Korea 넷플릭스 코리아
Переглядів 38 млн
0% Respect Moments 😥
00:27
LE FOOT EN VIDÉO
Переглядів 14 млн
NO NO NO YES! (40 MLN SUBSCRIBERS CHALLENGE!) #shorts
00:27
PANDA BOI
Переглядів 91 млн
Raspberry Pi versus AWS // How to host your website on the RPi4
8:39
13 Stunning Raspberry Pi Projects for 2024!!!
10:23
ToP Projects Compilation
Переглядів 145 тис.
DON'T Use Raspberry Pis for Servers! (Use THIS)
16:23
Hardware Haven
Переглядів 947 тис.
How to make an Nginx Webserver in 7 minutes
6:52
Kian Brose
Переглядів 25 тис.
Local AI Just Got Easy (and Cheap)
13:27
Data Slayer
Переглядів 219 тис.
Creating a Website on Raspberry Pi
13:36
Chris Titus Tech
Переглядів 37 тис.
I Can Save You Money! - Raspberry Pi Alternatives
15:04
Linus Tech Tips
Переглядів 3,2 млн
Raspberry Pi NAS vs. Asustor Drivestor 4, Is It Better to Buy or DIY?
17:57
Michael Klements
Переглядів 114 тис.
Your Old PC is Your New Server
11:07
Linus Tech Tips
Переглядів 6 млн
АННА КОШМАЛ і ОСТРОВСЬКИЙ в СРАЧІ #22
1:11:32
ЛЕВИ НА ДЖИПІ
Переглядів 672 тис.
Не понял прикола и собрал купюру из горы мусора
0:34
Сергей Милушкин
Переглядів 4,6 млн
НІКОЛИ! НІКОЛИ НЕ КЛИЧТЕ військового в ліс
0:24
Армія TV – Військове телебачення України
Переглядів 118 тис.