# Build yourself personal show off private server

Date: 2018-08-09

I want to write a post for those who want to make personal show off server, or as it called today CV platform.

<!--more Read more-->

TLDR - a full server with your own git repo, website, and playground  
For as low as 5$ a month.  


The server will have :  
Web server/ Blog - [Nginx](https://nginx.org/)  
Private git repo - [Gogs](https://gogs.io)  
And an app based on node.js  


## Server

We'll start with the server :  
Use the link : https://m.do.co/c/b8f7d3b94794  
To start a droplet at digitalocean, This link is my referral link, it'll give you 2 months free and if you'll stay after those 2 months I'll get 2 months free 

After you logged in click on create at the top right

Than choose:  
Ubuntu, 5$ machine, London, [add new ssh key](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/), one droplet, name and click create
 
Let it finish, And then you can ssh into the server using your ssh key

## Installations

Dependencies
```shell
apt update
apt install -y nginx nodejs npm unzip

```

Install [WordPress](https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lemp-on-ubuntu-16-04) for the blog

Gogs:

```shell

cd /opt
# you can go to https://github.com/gogs/gogs/releases/latest to find the last version of gogs
wget https://github.com/gogs/gogs/releases/download/v0.11.53/linux_amd64.tar.gz
tar -zxvf linux_amd64.tar.gz
rm linux_amd64.tar.gz
crontab -l > /tmp/gogs
echo "@reboot /opt/gogs/gogs web" >> /tmp/gogs
crontab /tmp/gogs
```

Node.js app:

```shell
mkdir -p /opt/myapp
cd /opt/myapp
```

Build your app there. Make sure your app runs on port 3001 for the Nginx proxy

Edit the nginx default end point  


```shell
vim /etc/nginx/sites-available/default
```

Download and start the CV page:

```shell
cd /var/www/html/
rm index.nginx-debian.html
wget http://css-tricks.com/examples/OnePageResume.zip
unzip OnePageResume.zip
rm OnePageResume.zip
cd OnePageResume
mv * ..
cd ..
rm OnePageResume/ -r
vim index.html
```

Enjoy.  


You can add or change any component, Just add it and redirect the Nginx proxy to the right port  


make sure to redirect your domain with all the subdomains to your server and redirect <g class="gr_ gr\_78 gr-alert gr\_spell gr\_inline\_cards gr\_disable\_anim_appear ContextualSpelling ins-del" id="78" data-gr-id="78">git</g>.[yourdomain].tld to port 3000 Gogs  
and app.[yourdomain].tld to port 3001 node js app  
and blog.[yourdomain].tld to the blog folder  
and all the rest to the default CV page

Good luck.  
And if you need help or support email me.
