I always wanted to try to setup a home based server. So I created a setup with Raspberry Pi, TP-link Router and a free Dynamic DNS service.
Stuff that you need :
- Raspberry Pi / Laptop / PC [I am using Raspberry Pi with Debian based OS]
- Cludflare or DNS service
- Own domain name [If you have]
- Working internet connection
Install Nginx or any web server in Raspberry Pi.
Use a DDNS service like freemyip.com
Go to freemyip.com and check your domain is available or not.
If available claim it and store the credentials.
Save the URL that appears on your screen.
Setup Dynamic DNS in your router. [Not necessary maybe I was not able to test without that due to clear field is not option available]
Get your IP address by running this command
1 curl -4 icanhazip.com
Update the DNS record with your IP
1 2 # replace <> with your values curl https://freemyip.com/update?token=<your token here>&domain=<your-ddns.freemyip.com>&myip=<your IP here>
Cool now you can access the server with the Domain you created with DDNS service. [In here freemyip.com]
If you have a domain and want to point that to new server then add a CNAME record.
1 CNAME your-domain.com your-ddns.freemyip.com
Now we don’t have static IP so it will keep changing after a while.
To update that you can create a cron to keep the things updated every minute.