# Linux cloud service

**URL:** https://discourse.nodered.org/t/linux-cloud-service/16797
**Category:** General
**Created:** [17 October 2019 08:53 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797 "2019-10-17T08:53:36Z")
**Posts on this page:** 14
**Page:** 2

<div class="post-metadata">

### Author: ![recursivecodes](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/recursivecodes/32/13422_2.png) [@recursivecodes](https://discourse.nodered.org/u/recursivecodes)
#### Post date: [24 October 2019 15:22 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/22 "2019-10-24T15:22:33Z")

</div>

I've updated my original post for installing/configuring on the Oracle Cloud to mention securing with username/password as well as posted a link to a new post that shows how to set up CertBot with Let's Encrypt to generate a valid cert. Thanks for the feedback. Let me know if you do try out the always free VM on Oracle Cloud and have any other feedback or questions.

Original Post (now updated):

> **[Installing Node-RED In An Always Free VM On Oracle Cloud](https://blogs.oracle.com/developers/installing-node-red-in-an-always-free-vm-on-oracle-cloud)**
>
> In this post we'll look at how to install Node RED in an "always free" VM on the Oracle Cloud.

New Post:

> **[Free SSL Certificates In The Oracle Cloud Using CertBot And Let's Encrypt](https://blogs.oracle.com/developers/free-ssl-certificates-in-the-oracle-cloud-using-certbot-and-lets-encrypt)**
>
> In this post we'll look at how you can enable HTTPS for your web application that runs on Oracle Linux in the Oracle Cloud by using an application called CertBot to create your SSL/TLS certificates via Let's Encrypt.

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [24 October 2019 19:13 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/23 "2019-10-24T19:13:11Z")

</div>

Great! Nice write up Todd @recursivecodes  
I've just purchased a .tech domain name from [namecheap.com](http://namecheap.com) (£1.60p for 12 months!) to fully evaluate the Oracle VM hosting, but I'm away from home till next week, so haven't got SSH access until then....

Just one observation on the tutorial; in the section 'Creating a certificate' you copy the new certificates to `/home/opc/.node-red/certs/` and then create a script to automatically move renewed certs to the same folder.  
But, in 'Deploying a site with your new certificate' the path that you have included in node-RED settings is `/etc/letsencrypt/live` instead of `/home/opc/.node-red/certs/`  
(or simply `('certs/cert.pem'),` should also work?)

---

<div class="post-metadata">

### Author: ![recursivecodes](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/recursivecodes/32/13422_2.png) [@recursivecodes](https://discourse.nodered.org/u/recursivecodes)
#### Post date: [25 October 2019 12:18 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/24 "2019-10-25T12:18:07Z")

</div>

Ahh, that's definitely a typo on my behalf. It won't work if you point to the LE directory (permissions). Thanks, I'll update the post!

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [29 October 2019 22:06 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/25 "2019-10-29T22:06:49Z")

</div>

Hi Todd @recursivecodes

I think there's a small typo in the latest tutorial, should `sudo firewall-cmd —reload` be `sudo firewall-cmd —-reload`  
otherwise it errors `firewall-cmd: error: unrecognized arguments: -reload`

Also, I'm having problems copying the certificates to `.node-red/certs`.  
If I run `cp /etc/letsencrypt/live/mydomain.co.uk/*.pem /home/opc/.node-red/certs/`

I get `cp: cannot stat ‘/etc/letsencrypt/live/myserver.co.uk/*.pem’: Permission denied`

adding sudo, I get `cp: cannot stat ‘/etc/letsencrypt/live/myserver.co.uk/*.pem’: No such file or directory`

If I check ownership;

```auto
sudo ls -la /etc/letsencrypt/live/myserver.co.uk/`
total 4
drwxr-xr-x. 2 root root 93 Oct 29 21:11 .
drwx------. 3 root root 52 Oct 29 21:11 ..
lrwxrwxrwx. 1 root root 48 Oct 29 21:11 cert.pem -> ../../archive/myserver.co.uk/cert1.pem
(Plus the other 3 certs)

```

Doing the same with the symlink locations;

```auto
sudo ls -la /etc/letsencrypt/archive/myserver.co.uk/cert1.pem

```

I get;

```auto
-rw-r--r--. 1 root root 1935 Oct 29 21:11 /etc/letsencrypt/archive/myserver.co.uk/cert1.pem

```

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [30 October 2019 20:53 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/26 "2019-10-30T20:53:03Z")

</div>

I eventually got there!!

Before the command in the guide `cp /etc/letsencrypt/live/node-red.toddrsharp.com/*.pem /home/opc/.node-red/certs/` it's necessary to change to 'root' privileges by entering `sudo su`, then everything thereafter runs smoothly.  
Prefacing 'sudo' to the command instead, does not work, and results in error messages.  
Also, in the section;

```auto
domain=[your domain name]
node_dir=/path/to/cert/copy/dir
node_user=opc

```

is

```auto
domain=your_domain_name
node_dir=/path/to/cert/copy/dir
node_user=opc

```

(no square brackets!)

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [25 November 2019 17:19 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/27 "2019-11-25T17:19:02Z")

</div>

Got mine going as well thanks to the @recursivecodes instructions

Wish I'd read @Paul-Reed notes before I did but worked out the --reload and the sudo for the certs myself 🙂

One question though - do we not have to alter

```auto
node_dir=/path/to/cert/copy/dir

```

to be

```auto
node_dir=/home/opc/.node-red/certs

```

???

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/1828f36e51a48fa3d9f46c6770edd8ec619b33d3.png)

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [25 November 2019 18:44 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/28 "2019-11-25T18:44:23Z")

</div>

> [@cymplecy](#):
>
> One question though - do we not have to alter
> 
> ```auto
> node_dir=/path/to/cert/copy/dir
> 
> ```
> 
> to be
> 
> ```auto
> node_dir=/home/opc/.node-red/certs
> 
> ```

Yes, that's correct.  
I've just created a TIG Stack (Telegraf, Influx & Grafana) in my second 'free' instance which is working really well, and have used the same shell script to copy the certs, and change their ownership.

```auto
#!/bin/bash

domain=dashboard.digitalnut.co.uk
node_dir=/etc/grafana/certs
node_user=grafana

cp /etc/letsencrypt/live/$domain/*.pem "$node_dir"/
chown $node_user "$node_dir"/*.pem

```

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [25 November 2019 18:56 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/29 "2019-11-25T18:56:04Z")

</div>

Once you get it all running smoothly, you can create & store a backup within Oracle of your instance, which can then be used to restore the image, should things go badly wrong 😉

In the 'free' version, you can store up to 5 backups (per each 'free' account - or more if you sign up to a paid plan).  
As they are full backups (instead of incremental), it's quite adequate, as you can delete off the oldest and stay within the 5 limit.

It can run the backup with the instance running, but I prefer to stop the instance first, do the backup, then restart.

 ![oracle_backup](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/38f3fcff619c6918f2cbebea17bab847fdc74bdc.jpeg)

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [28 November 2019 20:37 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/30 "2019-11-28T20:37:15Z")

</div>

@cymplecy Do you have any issues logging into the Oracle Cloud admin interface?  
Oracle seem to have invoked some security measures which make life difficult.

Most times that I login, I have to reset my password first and then login by following the email links, which is far from ideal.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [28 November 2019 22:25 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/31 "2019-11-28T22:25:56Z")

</div>

Once its auto-logged me out after period on inactivty - I've never been able to make it back in from the page it sends me to.

I just go back to

[oracle.com/cloud/sign-in.html](http://oracle.com/cloud/sign-in.html)

and I can get in from there every time with no bother

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [28 November 2019 22:40 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/32 "2019-11-28T22:40:10Z")

</div>

That's a different url than I've been using, thanks Simon.  
....Oracle is such a vast provider of so many products, and many interconnect, so maybe I was choosing the wrong route.

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [22 December 2019 23:42 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/33 "2019-12-22T23:42:21Z")

</div>

@cymplecy Simon, are you using Todd's [cloud backup script](https://blogs.oracle.com/developers/backing-up-your-always-free-vms-in-the-oracle-cloud)?  
I've just got it working in the Oracle Linux environment (it didn't work 'out-of-the-box' for me...).  
If you decide to give it a try, give me a shout & I'll share the changes that I've made.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [23 December 2019 09:11 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/34 "2019-12-23T09:11:31Z")

</div>

Not using it - I'm not running anything critical yet

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [27 December 2019 20:45 UTC](https://discourse.nodered.org/t/linux-cloud-service/16797/35 "2019-12-27T20:45:27Z")

</div>

Well before I forget...

The oracle `compartment id` is a [required parameter](https://docs.cloud.oracle.com/iaas/tools/oci-cli/2.7.0/oci_cli_docs/cmdref/bv/boot-volume-backup/list.html) of the command `bv boot-volume-backup list` (line 11 of the script), and without it, the script fails, so the solution is to add it into the script.

First grab the `compartment id` by scrolling to the bottom of your Oracle instance management page, and select Administration \> Tenancy Details

![bv](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a394c1d564c296048b006a27d0352004866a5f64.jpeg)

Show & copy your Tenancy OCID

![bv2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/7026393b9c9977cd8f8279f8129f147ec53bc024.jpeg)

Then edit the script to include the OCID, and add it as parameter to the `bv boot-volume-backup list` command. (2 changes).

```auto
#!/usr/bin/env bash
source ~/.bashrc

PROFILE_NAME=DEFAULT
BACKUP_NAME=grafana_monthly
TMP_BACKUP_NAME=$(date +%Y-%m-%d_%H-%M-%S)
COMP_OCID=ocid1.tenancy.oc1..aaaaaaaaot2dmwrtkyourownocidreferencepczfgitlq

echo "Running at ${TMP_BACKUP_NAME}."
echo "Getting previous backup..."

OUTPUT=$(oci bv boot-volume-backup list --compartment-id ${COMP_OCID} --display-name ${BACKUP_NAME} --lifecycle-state A$LAST_BACKUP_ID=$(echo $OUTPUT | /bin/jq -r '.id')
BOOT_VOLUME_ID=$(echo $OUTPUT | /bin/jq -r '.bootVolumeId')
etc, etc, etc

```

The script should now run ok, and can be automated by adding a cron task which is run by 'user' to `/etc/crontab`. ie;  
`0 4 * * 7 opc /home/opc/backup_script/./nodered_weekly.sh >/dev/null 2>&1`

NOTE; I have read that there is a way to make it unnecessary to provide the compartment id, but I couldn't get it to work, and the script author has not replied to support requests.

[Previous page](https://discourse.nodered.org/t/linux-cloud-service/16797.md?page=1)
