MyProxy: How  to easily setup free SSL on your server🔒
Tags: javascript, node, opensource, showdev
Published: 2020-01-06 15:58:13

---
title: MyProxy: How  to easily setup free SSL on your server🔒
published: true
description: MyProxy an easy app to setup free SSL on your server.
cover_image: https://thepracticaldev.s3.amazonaws.com/i/u5pqbsylmm6ftl0nqxcb.png
tags: #javascript #node #oss #showdev
---

Have you ever tried to setup a free SSL on your domain and subdomain?
If you did then you know how tough and boring it is... you have to:

1. Set up the server
2. Set up DNS records
3. Set up A and CNAME records
4. Create and serve SSL certificates

**Well you know what?!**

We have created [MyProxy](https://garagescript.github.io/myProxy/), that will help setup your domain records and create **unlimited free SSL** 🔒 on your domain names!


## What do you need?

A **Domain Name** and a **Server**.
Currently _(at the time of this post)_ we only support:
- **Providers:** [GoDaddy](https://www.godaddy.com/domains/domain-name-search?sp_hp=B&xpmst=A&xpcarveout=B) & [Name.com](https://www.name.com/)
- **Server:** [DigitalOcean](https://www.digitalocean.com/) - [AWS EC2](https://aws.amazon.com/ec2/?hp=tile&so-exp=below) - [GoogleCloud](https://cloud.google.com/) or a home server

## How does it work?

I will give you a quick overview on how easy it is to set up your server with new **SSL certificates**.

>
**_Hey dude I don't have time to read this, do you have a video instead?_**
Sure we do have a couple, and they are short:
- [Setting up MyProxy](https://youtu.be/q3uSyMfaRP4) _only 2:08s_
- [Using MyProxy](https://youtu.be/Tjx0BtpZmPc) _only 2:32s_
>
**_Wow! I would love to try, but you know I'm lazy... 🤷‍♂️_**
Haha that's why we made a sandbox [freedomains.dev](https://freedomains.dev/) so no excuse not to try it ☺️

---

### First you have to install and run **MyProxy** on your server.

Only 4 lines to copy and paste!

```shell
# 1. Clone the app
git clone https://github.com/garageScript/myProxy.git
# 2. Go to the app directory
cd myProxy
# 3. Install nodejs and all dependencies
./scripts/setup.sh
# 4. Run MyProxy
ADMIN=YOUR_ADMIN_PASSWORD npm run server
# That's it!
```

### Let's check out your freshly installed **MyProxy**!

Go to your server url: `http://your-server-ip-address:3000` 
The first time you will be prompted to enter:
- The admin password that you have set up
- Your domain provider’s API Keys

![Login page](https://thepracticaldev.s3.amazonaws.com/i/9ktwonibwjq6i8l9yclg.png)



After that all of your domain names will show up as below:

![MyProxy providers](https://thepracticaldev.s3.amazonaws.com/i/oz3r32adifoweq9vhnee.png)

Click the setup button next to the domain you wish to setup. 
_(could take up to 5 minutes so feel free to grab coffee ☕️)_

🎉 **and Voilà!** 🎉
Your domain is setup and you will be able to generate as many subdomain repositories as you want!

---

## Time has come to say "Hello World" to the world

Go to your server URL: 
`http://your-server-ip-address:3000` _(don't forget **:3000**)_

![MyProxy](https://thepracticaldev.s3.amazonaws.com/i/nr5asmmvhyt4ayo158g6.png)


Create a subdomain.
_(you should see a git link that was created for you)_

![git link](https://thepracticaldev.s3.amazonaws.com/i/9gs41qytr6vxz5cageer.png)


Now let's build your awesome `Hello World` app.
Your only job will be to copy and paste. 😉
_(SSH Authentication Issues? [Take a look here](https://github.com/garageScript/myProxy/wiki/Trouble-Shooting#ssh-issue))_

```shell
# 1. Git clone the app on your local machine
# Eg: git clone myproxy@freedomains.dev:/home/myproxy/david.freedomains.dev
git clone <your fullDomain repo>
# 2. Go to the app directory
# Eg: cd david.freedomains.dev 
cd <your fullDomain folder>
# 3. Tip: now's a good time to grab another coffee ☕️
npm init -y
npm i express --save
# 4. Create our app file
touch app.js
```

>
**_Hey wait! I already have an existing app that will change the world..._**
No worries, skip the step above and instead click on the download button to get the `deploy.config.js` file and move it into your existing app folder then follow the step below.

Open your favorite IDE (VSCode 😇).
Update `package.json` to include your app by adding this line: 
`"start:myproxy": "node app.js",`

```json
{
  "name": "david.freedomains.dev",
  "version": "1.0.0",
  "description": "",
  "main": "deploy.config.js",
  "scripts": {
    "start:myproxy": "node app.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "myproxy@freedomains.dev:/home/myproxy/david.freedomains.dev"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.17.1"
  }
}

```

Copy and paste this code snippet into `app.js`.

```js
const express = require('express');
const app = express();
app.use(express.static('public'));

app.get('/', (req, res) => {
  res.send('Hello World 💫');
});

app.listen(process.env.PORT || 8123);

```

Almost done! Hold on!
Open your terminal and from your app folder use git to add and commit your changes, then push up to myProxy. 🚀
 
```shell
git add .
git commit -m "Initial Commit"
git push origin master
```

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/5r72ioushpiddipn6y1c.png)

Congrats! You did it!💪 
Look at your wonderful "Hello World 💫" set up with a **SSL certificate**.😍


![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/fgcc3kqumeb53fiur2sh.png)


![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/7s54paeze3ililca0dpm.jpg)

---

It's my first post and I hope you liked it, please feel free to give any feedback.

MyProxy has been made by my team and I. We hope that it can be as useful for you as it is for us.
We are new to software engineering so if you find areas where this app could be improved, please let us know by creating an issue.
We are excited to keep learning!

**Link:**
[MyProxy Web Page](https://garagescript.github.io/myProxy/)
[MyProxy GitHub](https://github.com/garageScript/myProxy)
[Playground Freedomains](https://freedomains.dev/)
[Youtube Setting up MyProxy](https://www.youtube.com/watch?v=q3uSyMfaRP4)
[Youtube Using MyProxy](https://www.youtube.com/watch?v=Tjx0BtpZmPc)