Question

Is it Premature for Me to Think in Terms of Hosting my "Toy" Webserver?

During the lockdown, I have started building a “toy” Webserver on my Windows 10 laptop, using Node and Express. It is not much past “Hello World” but I can access my pages from browsers with localhost URL’s.

I know my laptop’s IP address. It is connected to an ISP. I tried to access my site from my IPhone but it didn’t work. I know that the IP address is correct–I can access my site from a browser on my laptop using that IP address and the server’s port number (of 3000).

I would love to host my page somewhere and access it from my laptop, just to see how this is done. I don’t expect any outside users to access my site for the next several months, possibly forever. So, this will be just for testing purposes.

One of the options is to get the cheapest account from Digital Ocean.

  1. Is there a free trial period?

  2. If not, am I committing myself to a certain period of time?

  3. Can I move my project to a droplet without going through git/Github?

  4. What exactly do I get in my droplet? Can I get Windows 10 so that I can start my server there (just I do it locally)?

  5. Will I get an IP address for accessing my server?

  6. Is this all premature? Should I wait till my server is better fleshed out?

  7. My server might eventually be a place to serve my memoir. Something like WordPress will be the ideal choice. However, I am a retired programmer and Web development in itself is of interest to me. So, I have two conflicting goals: (a) Improve my Web skills (b) Get my message out to the world (so to speak).

Thanks.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Hi there @shakervc,

This is a great question!

I don’t think that this is a premature decision at all. In my opinion, it is going to be a great learning experience to deploy a Droplet, install the necessary and upload your website/project and also it is quite fun and sometimes challenging if you do it for the first time.

I will try to answer all of your questions:

  • Is there a free trial period? - Yes, you can sing up via this link here $100 free credit to deploy any Droplets/Servers that you would like

  • If not, am I committing myself to a certain period of time? - There are no commitments, you can delete your server at any time and you will no longer be billed for it. You are also going to be charged per the hour so you can deploy/create a server, run some tests and delete the server after that, and you would be charged only for the time that the server was up, for example, if you go for the smallest $5 Droplet, it would cost you $0.007 per hour.

  • Can I move my project to a droplet without going through git/Github? - Yes you can use SFTP to upload your project to the Droplet directly without having to upload it to GitHub first.

  • What exactly do I get in my droplet? Can I get Windows 10 so that I can start my server there (just I do it locally)? - While creating a Droplet, you can choose the operating system, currently, you can choose between various Linux and Unix distributions like Ubuntu, Debian, CentOS, FreeBSD and a lot more.

I could recommend starting with Ubuntu as it is really well supported and a bit easier. There are also great tutorials on the DigitalOcean website on how to install NodeJS and Express on Ubuntu that you could follow:

https://www.digitalocean.com/community/tutorials/how-to-install-express-a-node-js-framework-and-set-up-socket-io-on-a-vps

  • Will I get an IP address for accessing my server? - Yes, each server comes with 1 dedicated IPv4 IP address

  • Is this all premature? Should I wait till my server is better fleshed out? - I think that it is going to be nice to gain some experience with setting up your own servers, that way you would feel more comfortable with it by the time your project is ready

  • Installing WordPress on the same Droplet as your main project would not be a problem at all, you can use Nginx as a reverse proxy to serve multiple sites or projects from the same Droplet.

On another note, you are not able to access your project from your phone probably because of a few things:

  • Your Phone needs to be connected to the same network
  • You need to open port 3000 via your Windows Firewall for incoming TCP connections

If you want to access your project from the outside world, what you need to do is set up Port Forwarding via your home router, so that the traffic is forwarded from your public IP to your local network accordingly. However, if you decide to go with creating your Droplet instead, making those changes to your router would not be needed.

Hope that this helps! Good luck with your project and keep us posted with the progress! Regards, Bobby

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

More success.

I did the prep steps listed here.

[Initial Server Setup with Ubuntu 18.04] (https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04)

I also did the following steps to install distro stable nodejs

sudo apt update sudo apt install nodejs sudo apt install npm

These are described in

[How To Install Node.js on Ubuntu 18.04] (https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04)

I then did the following:

npm install --save express npm install --save handlebars

And voila, I was able to run my application successfully, without having to upload node_modules from my laptop.

I am again beyond thrilled.

I don’t remember installing nodejs and npm on my laptop. (I do remember installing express and handlebars.) I guess that I must have done it.

Shaker

I was able to run my server from the droplet and access it from my laptop. So were a couple of friends living in different locations.

I am beyond thrilled. I have a ton of cleanup to do and am sure will have a lot of questions.

Digital Oceans is very easy to work with.

Thanks for your reply, Bobby. More questions.

Editing after initial posting.

  1. Should I ask additional questions in this thread or start new threads?

  2. I created an Ubuntu droplet which I am able to login via PUTTY using SSH from my Windows 10 laptop. (This is the only way I can login.) I created a user called shaker and went through the motion of installing nodejs and npm. I am not sure that I did this 100% correct.In particular, I did not give shaker SSH credentials, if you understand what I mean. There were some instructions asking me to do something like this but I skipped it. I will be happy to do this during the next pass.

EDIT: I can login via Filezilla also.

  1. I am not able to login in as shaker from PUTTY.

EDIT: I am sure this has to do with shaker not having SSH access.

  1. I tried to install Filezilla but my antivirus software flagged it as having adware. I aborted this step. Should I use a different client? Do I need to load anythings on the droplet?

EDIT: I found a version of Filezilla without adware, doenloaded it, and was able to SFTP files to the droplet, logged in as root.

  1. I want to SFTP my project on Windows 10 to the droplet. What is my next step?

EDIT: This has been done.

  1. https://www.digitalocean.com/community/tutorials/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server#how-to-connect-with-sftp

has commands like these:

ssh sammy@your_server_ip_or_remote_hostname

sftp -oPort=custom_port sammy@your_server_ip_or_remote_hostname

Where are these entered?

EDIT:

  1. It looks like I have to give shaker SSH capability next. The above tutorial addresses this topic. Any other pointers? Thanks.

Thanks for all you help. They have been spot on.

Shaker