Skip to content

Instantly share code, notes, and snippets.

@thursby
Last active June 27, 2022 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thursby/abbd778d2741ddd5d1a42dcb39812601 to your computer and use it in GitHub Desktop.
Save thursby/abbd778d2741ddd5d1a42dcb39812601 to your computer and use it in GitHub Desktop.
Install Cloud9 IDE under CentOS 7 with Let's Encrypt SSL

First, get a working CentOS 7 server with your preferred stack. Next, install requirements:

yum groupinstall -y development
yum install -y git glibc-static epel-release nodejs npm

Now clone the git repo and Install the Cloud9 SDK:

git clone https://github.com/c9/core.git c9sdk
cd c9sdk/
scripts/install-sdk.sh

Get DNS set up to point to the box, then use Certbot to get a Let's Encrypt cert:

sudo yum install certbot
certbot certonly --webroot -w /var/www/html/ -d $hostname

The output from this command shows you where the cert is saved.

Combine the cert and private key, and put the result somewhere c9 can see it.

cd /etc/letsencrypt/live/$hostname/
openssl rsa -in privkey.pem -out privkey_rsa.pem
touch combined_key.pem | cat privkey_rsa.pem fullchain.pem >> combined_key.pem
mv combined_key.pem /home/$user/c9sdk
chown $user:$user /home/$user/c9sdk/combined_key.pem

To keep it running, use Forever:

sudo npm install forever -g
cd c9sdk
forever start server.js -p 8080 -w ~/workspace/ -l 0.0.0.0 --auth developer:cleverpassword --secure combined_key.pem
@darkcyber
Copy link

Hi @thursby, sorry I have OOT question, do you know why in my c9 interface it's shown

Failed to write to 'state.settings'. options.stream must be readable. .

Maybe you could give me some advice. Thanks.

@AslaApps
Copy link

Hi @thursby, sorry I have OOT question, do you know why in my c9 interface it's shown

Failed to write to 'state.settings'. options.stream must be readable. .

Maybe you could give me some advice. Thanks.

Looks like you have a problem with folders permissions.
Avoid to install the C9 ide in the root directory of your server.
And don't install it with root, Use another user and start the server with that user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment