> This is a standalone, distribution-specific version of `INSTALL.md`. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)
`piku` setup is simplified in modern Debian versions, since it can take advantage of some packaging improvements in [uWSGI][uwsgi] and does not require a custom `systemd` service. However, Stretch still ships with Python 3.5, which means it's not an ideal environment for new deployments on both Intel and ARM devices.
Download and install [Raspbian Stretch](https://www.raspberrypi.org/downloads/raspbian/) onto an SD card.
After you install it is recommended that you do the following to update your installation to the latest available software.
```bash
# update apt-get
sudo apt-get update
# upgrade all software
sudo apt-get upgrade
```
Configure your installation. It is recommended that `Change Password` from the default and setup `Locale Options` (Locale and Timezone) and `EXPAND FILESYSTEM`. You will also want to `Enable SSH`.
```bash
# configure your installation
sudo raspi-config
```
At this point it is a good idea to `sudo shutdown -h now` and make a backup image of the card.
`piku` requires a separate user account to run. To create a new user with the right group membership (we're using the built-in `www-data` group because it's generally thought of as a less-privileged group). This user (`piku`) _is not supposed to login to your system_. Instead, you'll interact with `piku` via SSH, and set things up by using `su`.
To create the `piku` user account, enter the following commands:
You will have to copy your ssh public key to the raspberry pi from your main system. If you already have `ssh`d into your newly installed pi you can do the following:
[uWSGI][uwsgi] in Bionic requires very little configuration, since it is already properly packaged. All you need to do is create a symlink to the `piku` configuration file in `/etc/uwsgi/apps-enabled`:
`piku` requires you to edit `/etc/nginx/sites-available/default` to the following, so it can inject new site configurations into `nginx`:
```
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm;
server_name _;
location / {
try_files $uri $uri/ =404;
}
}
# replace `PAAS_USERNAME` with the username you created.
include /home/PAAS_USERNAME/.piku/nginx/*.conf;
```
## `incron` Configuration
To detect configuration changes and tell `nginx` to activate new `piku` sites, we use `incron`. Create `/etc/incron.d/paas` with the following contents:
```bash
# replace `PAAS_USERNAME` with the username you created.