- Install Raspbian and Etcher
- First config in sd-card/boot
- USB (SSH) connection
- WiFi connection
- Install Docker
- Install Docker-Compose
- Run server
- Install GIT
- Install NODE and NPM
- Install PM2
- Useful tools
Download Raspbian (https://www.raspberrypi.org/software/operating-systems/)
Install OS using Etcher (https://www.balena.io/etcher/)
touch ssh
sudo nano config.txt
and add dtoverlay=dwc2
at the bottom and save
sudo nano cmdline.txt
after the word rootwait
add modules-load=dwc2,g_ether
with spaces
(ONLY FOR LINUX) In internet connection setting (IPv4 card) change to Link-Local only
Try to connect with [email protected]
or lunch ping raspberrypi.local
and use ssh pi@<ip>
(default password is raspberry
)
For WiFi connection (when you are in SSH)
cd /etc/network
nano interfaces
add at the bottom
#auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
and save
cd /etc
nano rc.local
add after exit 0
ifup wlan0
and save
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
add at the bottom
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=YOUR_COUNTRY
network={
ssid="NETWORK"
psk="PASSWORD"
}
if you need more networks just add next
network={
ssid="NETWORK"
psk="PASSWORD"
}
and save
Type sudo wpa_cli reconfigure
to apply changes and sudo reboot
sudo nano /boot/cmdline.txt
Add cgroup_enable=memory swapaccount=1
at the end
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker pi
sudo reboot
docker version
docker run hello-world
sudo apt-get install libffi-dev libssl-dev
sudo apt install python3-dev
sudo apt-get install -y python3 python3-pip
sudo pip3 install docker-compose
sudo systemctl enable docker
cd server
docker-compose -f docker-compose.yml up -d
Run the following commands
sudo apt update
sudo apt install git
Verify the installation
git --version
If you have problem with Docker, you can install NODE and NPM.
We need version for ARM V6, the latest NODE with this version is a NODE 10.
wget https://nodejs.org/dist/latest-v10.x/node-v10.24.1-linux-armv6l.tar.xz
tar -xJf node-v10.24.1-linux-armv6l.tar.xz
cd node-v10.24.1-linux-armv6l/
sudo cp -R * /usr/local/
node -v
npm -v
sudo npm install -g pm2
pm2 status
Run application on PM2
cd ~/your-awesome-node-app/
pm2 start index.js
For "save" setup after reboot you need run:
pm2 save
and after reboot
pm2 resurrect
Run PM2 on startup
pm2 startup
sudo env PATH=$PATH:/usr/local/bin /usr/local/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
Reboot for test
sudo reboot
- https://pinout.xyz/pinout/5v_power - pins descriptions