March 12, 2017

SSL for Raspberry Pi Nginx server with dynamic IP and Custom Domain

This posting is about how to host your own Raspberry Pi web server at home with dynamic IP with custom domain and SSL.

I tried many different methods and different ways to install certbot, but on RPi Raspbian Jessie Lite, this is the only way.


Host own web site(s) on Raspberry pi, with custom domain from home, and support SSL.


  • Raspberry pi + Raspbian Jessie Lite
  • Fast internet
  • Your ISP allows port 80 and 443
  • Own domain and you can edit DNS


  1. Set up Raspberry pi with static IP, and configure your router to port forward to your RPi web server, port 80 and 443(SSL) 
  2. Set up custom domain with dynamic IP.  Make sure you have correct settings in DNS set up.
  3. Set up Nginx on RPi

Set up SSL on RPi  

  • You have to do above prep-work before follow below steps.
  • It is assumed your web site's root doc directory is: /var/www/mysite/
  • It is assumed your custom domain is:
  • Nginx is up and running, and accessible by the custom domain.


March 11, 2017

Custom domain and dynamic IP


Make home Raspberry Pi server accessible from outside with custom domain.


  • Raspberry Pi with Raspbian Jessie Lite
  • High speed internet at home (e.g. Fios), dynamic IP
  • Appropriate ports are open: 80, 443, 23, etc.
  • Own domain and access to DNS setting


March 10, 2017

Raspberry Pi mount exFAT Flash Drive as storage


Mount USB flash drive to RPi.

I can use large SD card, but:
(1) I already have a small SD card I want to re-use, and want to separate OS and data.
(2) I want to back up/store from Windows for data files.
(3) large capacity flash drive is cheap.


  • Windows 10 64bit
  • RPi, Raspbian Jessie Lite

March 8, 2017

Post Raspberry Pi status on Twitter


Tweet RPi (and CHIP) status with temperature, external IP, etc.


  • Raspbian Jessie Lite
  • Python 2.7

Prepare Twitter Account

A Twitter account is needed to publish the status, and set it to private unless you want to make postings public.
  1. Register Twitter account
  2. Log on to Twitter with the account.
  3. Go to
  4. Change setting in Privacy and safety, Email notification, 
  5. Go to
  6. Create New App and get following:
    • Consumer Key (API key)
    • Consumer Secret (API Secret)
    • Access Token
    • Access Token Secret
From your regular Twitter account, follow above account.

March 1, 2017

Setting up Raspberry Pi, wifi, static IP


Set up headless RPi, Wifi with static IP.


  • Windows 10 64bit
  • Raspberry Pi 1A, 1B, 3B, Zero
  • External monitor, powered USB hub, wifi dongle, keyboard/mouse.
  • RPi OS; Raspibian Jessie Lite 

Although I will be using RPi headless, the easiest way to set up is hook up external monitor, powered USB hub, connect keyboard mouse + wifi module.  I tried different headless set up, but they all were too inconvenient, especially with RPi models with only one USB port.

Install/Setup Raspberry Pi on SD

  1. Raspberry Pi OS download:
  2. I got the easy one, Raspbian Jessie Lite,
  3. Use Win32 Disk Image to write the OS onto SD card 

Setting up RPi