DEV Community

namya
namya

Posted on

how to start self hosting πŸš€

picture

in this article we will be setting up a raspberry pi server and installing docker and portainer on it. so you can selfhost your own services on it.

picture

First Steps

  • install the raspbian os on your sd card. you can follow this tutorial from 2:25 ⏩ prep the Raspberry Pi.
  • connect the raspberry pi to your wifi network.
  • ssh into the raspberry pi using the ssh command.
ssh pi@ipaddress
Enter fullscreen mode Exit fullscreen mode
  • update and upgrade the system using the command below.
sudo apt update && sudo apt upgrade
Enter fullscreen mode Exit fullscreen mode
  • and reboot the system.
sudo reboot
Enter fullscreen mode Exit fullscreen mode

congratulations you have now installed the raspberry pi.

  • now you can install the following software.
sudo apt install git
sudo apt install nvim
    ...
        ...
            ...
Enter fullscreen mode Exit fullscreen mode

installing docker

to install docker, clone this repo and run the install script.

git clone https://github.com/Ayman-s-Lab/selfhosted-pi.git
cd selfhosted-pi/installation-scripts
chmod +rx docker.sh
./docker.sh
Enter fullscreen mode Exit fullscreen mode

Remember to logout/reboot for the changes to take effect.

logout
Enter fullscreen mode Exit fullscreen mode

ssh into the raspberry pi again

installing portainer

portainer is a web application that can be used to manage and easily deploy your docker containers .

to install portainer, open th installation-scripts folder and run the install script.

cd installation-scripts
chmod +rx portainer.sh
./portainer.sh
Enter fullscreen mode Exit fullscreen mode

yeah, now you can access portainer at http://ipaddress:9000 .

you created a new administrator user and chose docker as a container env aaand you are ready to goπŸŽ†.

Click Settings, in the bottom-left corner, and paste the Portainer v2 json file link from below into the "App Templates" box.
this is the one i use for my portainer.
i will create my own soon.

https://raw.githubusercontent.com/ntv-one/portainer/main/template.json
Enter fullscreen mode Exit fullscreen mode

You're done! Now just click App Templates and deploy applications!

done

Thanks for reading this article, i hope you enjoyed it.

if you have any questions or suggestions, feel free to contact me on twitter

dont forget to give this project a star⭐ to support me.

Top comments (0)