Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 90,932 Points

Deploying Node.js website to a server!

Hi all.

I hope everyone has had a great Christmas and all the best wishes for the year ahead.

My learning focus has recently shifted to node.js, which I've done before but I'm trying to add some Node projects to my portfolio.

When I last did the Dynamic Website project, which I accept was some time ago I was so sure that I was able to access it via a location in my server. So I must have been able to upload it via FTP, right?

Yet I can't find a single instruction or walkthrough that allows me to do it. So I must have been mistaken. Or got lucky in some way.

What is an easy way to a website made in Node to a web server? Is there an npm package that can do it? Maybe an equivalent of Create React App for node I haven't heard of?

I want to develop node projects but it'd be much better use if I can serve it somewhere preferably on my own server.

1 Answer

Hello, I think in order to do that your server/platform should have NodeJS installed if you're using Ubuntu as an OS, maybe you can follow this article https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04

In case it's not mentioned in the article, after deploying enables the UFW firewall to allow only SSH (port 22, rate limited), HTTP (port 80), and HTTPS (port 443) access.

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 90,932 Points

Thanks Mehdi,

Having accepted there's no other method of doing it, I managed to set up a droplet on DigitalOcean but the recommended public link for it isn't working. I think one reason for this is I need to set up an NPM project for it but it looks like I've done everything else right.

I'll get there in the end, I think.