Help setting up a server and deployment procedure from Wappler to run NodeJS

Hi all,

I’m looking at DigitalOcean/Vultr or Linode - I have no expertise deploying/setting up a server so I’d like to see if anyone can help me with this, so I can learn how to do it correctly.

Deploying to Heroku was super simple from Wappler- but there is no local file storage on Heroku, so I’d like to use the local disks that come with one of the above.

Yell out to @Excede, he has just gone through that exercise on Linode.

Thanks @ben - I was going to, but from the message I saw, he got up and running with Docker, I’m not using Docker for this app

1 Like

I’m in the same boat. Just started up a Linode server a couple of days ago to start getting my head around it all (i’m a long way off deployment still).

Its been a bit overwhelming to say the least. You finally get good at building web apps…and then a whole new world of jargon, terminology, languages, software, etc etc opens up :slight_smile:

Let me know how you go when you’re all done. Upcloud looks good as well but don’t have a DC in Australia so not for me just yet

Will do @Philip_J - Heroku was so simple with Wappler - just no file storage which is a real shame. Hopefully someone’s willing to pitch in and help here, or explain to people like us how to take the app to the next step and deploy it on any server.

I say the thread on the file storage. I don’t quite get why you need that (i’m sure you do). Is it to store media type data that isn’t really stored in a DB?

Just simple static assets, like a users avatar photo, the sites logo etc… Heroku doesn’t have persistent storage, so while it holds the codebase, and the app operates just fine - it won’t hold user uploads/storage.

On Heroku:

" Heroku has an “ephemeral” hard drive, this means that you can write files to disk, but those files will not persist after the application is restarted. By default Active Storage uses a :local storage option, which uses the local file system to store any uploaded files. While file uploads that are stored with the :local option will appear to work at first, the attachments will exhibit seemingly strange behavior and eventually disappear. The files will go away when the app is deployed, or when it is automatically restarted (once every 24 hours)."

Yeah right. That is a shame. If only for user profile pics

1 Like

I can say we are very happy with Linode running an linux server with plesk, ngnix (proxy), nodejs. So easy to manage!

You should check this out - Roll your own PaaS - Heroku alternative (Part 1)

we use cPanel - it helps us navigate server quite easily. has node.js support as well.
better to get a VPS with a cPanel license, than buying the cPanel license separately, for ref the provider we use is chemicloud.com

Hi, would you mind making a tutorial for your stack? I’m currently using heroku too for ease of development, eventually would like to switch to something more reliable and cheaper.

@Philip_J and @fdgfdgfdg

Managed to get up and running on DigitalOcean. Plesk was the key, so thank you @Excede for raising my awareness on this.

Process in brief:

  1. Sign up to DO, I chose an Ubuntu Plesk setup for the droplet.
  2. Go through steps, until Plesk is setup, in the meantime I created a subdomain and pointed my DNS at it, and created the domain in DigitalOcean.
  3. Login to Plesk.
  4. Deploy NodeJS, check install was correct.
  5. Setup domain in Plesk, connect to Git, create FTP account.
  6. I then created a separate Git to the Heroku one, deployed to this and this is what I connected to via SSH.
  7. Deployment is working fine, and upload via FTP appears to be working fine now.

Issues i’m still encountering:

  • if I hit the IP, or the main domain (or any non defined url) then I just get directed to the Plesk login, instead of being routed to my default index.js / other file (e.g. login screen).
  • Image paths are broken, some work fine, some just don’t load the image, even though I’ve uploaded correctly. Noting those that are not loading are .svg files, so perhaps I’m just missing a setting somewhere.
2 Likes

Thanks for this @mgaussie. Appreciate the brief write-up

I had a similar playing around experience the last couple of days on Linode but am looking at Docker deploy so it will be a bit different. I’ve yet to try Plesk but agree that this would make a difference in making it easier.

One thing I did see that might help your 1st problem mentioned (and i may be way off here as i’m no expert) But i remember reading something about when you’re setting up your sub-domains or mapping your DNS records to make sure you set up a
*.mydomain.com record.

I think its called a wildcard domain. Not sure if that has ANYTHING to do with your issue but it might.

A wildcard DNS record is a record in a DNS zone that will match requests for non-existent domain names. A wildcard DNS record is specified by using a * as the leftmost label (part) of a domain name, e.g. *.example.com . The exact rules for when a wild card will match are specified in RFC 1034, but the rules are neither intuitive nor clearly specified. This has resulted in incompatible implementations and unexpected results when they are used.

Thanks @Philip_J - I’ve pointed my DNS sub directly at the sub in DigitalOcean, so while I’m not using a wildcard - that’s all seemingly doing fine.

If you don’t mind me asking, why are you going for a docker deploy? Do you feel that’s a better way to manage things? I haven’t really played around with Docker tbh.

At this stage I think I will be deploying each new customer/client in their own docker container to ensure complete isolation of data etc. Each client needs their own sub-domain anyway so it’s not like onboarding is an instant process. In theory deploying a docker container is easy, but I’ve yet to do it.

I’m still trying to find the best way to manage this, but that is my current thinking. I hope to test it out today so I know my path going forward.

Nice, ok, peaked my interest in Docker - testing it out now on a new droplet.

With digital ocean it seems very easy as you can add a Docker Machine and instant deploy directly through Wappler.

This might have something do do with the assets not working consistently.

1 Like