{"id":17790270,"url":"https://github.com/shosta/syncthing-on-raspberry-pi","last_synced_at":"2025-09-11T18:35:50.504Z","repository":{"id":146559445,"uuid":"99698409","full_name":"Shosta/Syncthing-on-Raspberry-Pi","owner":"Shosta","description":"Deploy a Syncthing service on a Raspberry Pi to make your personnal Dropbox at home.","archived":false,"fork":false,"pushed_at":"2017-08-16T13:42:44.000Z","size":423,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T01:17:44.659Z","etag":null,"topics":["deployment","dropbox","raspberry-pi","syncthing"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shosta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-08T13:53:11.000Z","updated_at":"2024-12-03T16:53:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f6e2375-9767-40f7-b998-08bd4fa4c207","html_url":"https://github.com/Shosta/Syncthing-on-Raspberry-Pi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Shosta/Syncthing-on-Raspberry-Pi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shosta%2FSyncthing-on-Raspberry-Pi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shosta%2FSyncthing-on-Raspberry-Pi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shosta%2FSyncthing-on-Raspberry-Pi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shosta%2FSyncthing-on-Raspberry-Pi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shosta","download_url":"https://codeload.github.com/Shosta/Syncthing-on-Raspberry-Pi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shosta%2FSyncthing-on-Raspberry-Pi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274685959,"owners_count":25331086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployment","dropbox","raspberry-pi","syncthing"],"created_at":"2024-10-27T10:41:58.989Z","updated_at":"2025-09-11T18:35:50.431Z","avatar_url":"https://github.com/Shosta.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ccenter\u003e\n  \u003ch2 style=\"border-bottom: none;\"\u003e Install Syncthing on a Raspberry Pi to create your own Dropbox. \u003c/h2\u003e\n\u003c/center\u003e\u003cbr\u003e\n\n\n### What is Syncthing?\n\n**Syncthing** is an open source project that replaces proprietary sync and cloud services with something open, trustworthy and decentralized.\nIt is available on a lot of operating software which is very interesting for us.\n\nYou can learn more about it at \u003ca href=\"http://syncthing.net\"\u003esyncthing.net\u003c/a\u003e\n\n### 1. Set up your Raspberry Pi\n\n\u003c!-- anchor --\u003e\nDownload Raspbian at the following location :\n[https://www.raspberrypi.org/downloads/raspbian/](https://www.raspberrypi.org/downloads/raspbian/)\n\nBurn the downloaded image to your microSD card.\nIf you are on Linux or MacOS and if you are a command line person, you could use the dd command.\n\nYou can find a perfect explanation of the process [here](https://www.raspberrypi.org/documentation/installation/installing-images/).\n\nPersonnaly, I love [Etcher](https://etcher.io/) which is an application to burn images on SD cards.\nAs Etcher is based on the Electron framework, it works perfectly on Linux, MacOS or Windows.\n\n![Etcher animation](/SetUpRaspberryPiImages/etcherScreenshot.gif)\n\n\nI highly recommend to download this program as you are going to use it a lot starting playing with the Raspberry Pi.\n\u003c!-- anchor --\u003e\n\n### 2. Connect your Raspberry Pi to Wifi \n\n\u003c!-- anchor --\u003e\nTout d’abord, nous allons éditer le fichier _wpa_supplicant.conf_\n\n`sudo nano /etc/wpa_supplicant/wpa_supplicant.conf`\n\nRendez-vous à la fin du fichier et ajoutez la définition de votre box en suivant ce template :\n\u003enetwork={\n    ssid=\"Your box name\"\n    psk=\"The security key of your box\"\n    key_mgmt=WPA-PSK\n}\n\nRemplacez `\"Your box name\"` par le SSID de votre box internet et `\"The security key of your box\"` par le mot de passe de votre box.\n\u003eSi votre box utilise une clé de type WEP plutôt que du WPA/WPA2, insérez la valeur `NONE` dans `key_mgmt`, pour obtenir quelque chose de la forme `key_mgmt=NONE`.\n\nVotre Raspberry Pi 3 est maintenant configuré pour se connecter à internet via sa puce Wi-Fi.\n Il ne vous reste plus qu’à démarrer le Wi-Fi de la Raspberry Pi avec cette commande :\n`ifconfig wlan0`\n##### Change the Raspberry Pi hostname :\nType the following command in a Terminal:\n`sudo raspi-config`\nto change the Raspberry Pi hostname on your network.\n\nSo you can access it on your network even if it has a dynamic IP address.\n\n\u003c!-- anchor --\u003e\n\n### 3. Secure your SSH connection \n\n\u003c!-- anchor --\u003e\n##### Change the pi default password :\n`sudo passwd pi`\n\nThis is one of the **most important** step.\nIf you don't change the default Raspberry Pi password, you let it open to hackers as the default user and password is known and hackers made some script to look for Raspberry Pi on the network with the default user and password.\n\n##### Create a new user :\n\nAdd it to the Sudo group\n\n##### Configure the SSH connection :\n\n\n\n##### Limit the SSH connection to your new user :\nWe use sshd master configuration file to disable root login and this will may decrease and prevent the hacker from gaining root access to your Linux box. We also see how to enable root access again as well as how to limit ssh access based on users list.\nDisable SSH Root Login\nTo disable root login, open the main ssh configuration file /etc/ssh/sshd_config with your choice of editor.\n\n##### Change the SSH default port : \nLimit SSH User Logins\nIf you have large number of user accounts on the systems, then it makes sense that we limit remote access to those users who really need it. Open the `/etc/ssh/sshd_config file`.\n`sudo nano /etc/ssh/sshd_config`\n\nAdd an AllowUsers line at the bottom of the file with a space separated by list of usernames. For example, user tecmint and sheena both have access to remote ssh.\n\nAllowUsers tecmint sheena\n\n\nChange it from 22 (default for ssh) to a free one. 3321 should be ok.\n\nLook for the line : \nWhat ports, IPs and protocols we listen for\nPort 22\n\nAnd Change Port 22 to Port 3321\n\nNow to connect to your pi using ssh you have to specify the port :\n`ssh yourname@yourRaspberryHostname -p yourNewSshPort` (3321 in the example).\n\nIf you have that error : \n\u003e`Warning: the ECDSA host key for 'myserver' differs from the key for the IP address\nthat means that the ssh key in the known_hosts file changed (that’s indeed the case).`\n\nSo back up your ssh known_hosts file\n`sudo cp ~/.ssh/known_hosts ~/.ssh/known_hosts.bak`\n\nThen open the file and delete the former key :\n`sudo nano ~/.ssh/known_hosts`\n\n`ctrl-X then Y`\n\nThen your ssh connection should be secure enough.\n\u003c!-- anchor --\u003e\n\n### 4. Automount your NAS or Hard Disk Drive \n\n\u003c!-- anchor --\u003e\nThis works for any network storage or Hard Drive.\n\nI personnaly have a WD MyCloud NAS. It is the simplest and cheapest NAS device from Western Digital. \n![WD MyCloud NAS](./AutomountHardDrivesImages/MyCloud.jpg)\n\nIt is a very good device. But it doesn't have all the possibilities of more expensive NAS devices.\nThe Raspberry Pi is the perfect device to do bring a lot of excellent new features to it at the cheapest price.\n\n##### 1. Configure the fstab file :\nFirst, backup your fstab file if you mess something configuring it :\n`sudo cp /etc/fstab /etc/fstab.bak`\n\n##### 2. Create folder in the /mnt/ folder so that you can mount your network share in that folder\n`sudo mkdir WDMyCloudShares`\n`sudo nano /etc/fstab`\n\nAt the end of the file add the following lines :\n\u003e`//ShostaCloud/Remi/Vidéos/Films /home/remi/WDMyCloudShares/Videos cifs user=yourLogin,password=yourPassword,uid=remi,gid=remi,x-systemd.automount 0 0`\n##### TODO: Add a screenshot with the fstab properly modified.\n\nReboot to verify that it works properly :\n`sudo reboot`\n\nWait for the reboot, then check the mounted volumes :\n`df -h`\n\u003c!-- anchor --\u003e\n\n### 5. Backup your Disk Image \n\n\u003c!-- anchor --\u003e\nNow that you configured your Raspberry Pi, it is wise to backup your configuration in case something got wrong in the later configuration.\nSo you don't need to redo everything from the beginning.\n\n##### 1. Shutdown your Raspberry Pi :\n\n`sudo shutdown`\n\nGet the SD Card out of the Pi and put it back to your Mac/Linux/Windows PC\n\n##### 2. Backup the Raspberry Pi image to your computer : \n\nOn Mac type : \n`sudo dd if=/dev/rdisk1 of=/path/to/backup.img bs=1m`\n\nor to reduce the amount of space :\n`sudo dd if=/dev/rdisk1 bs=1m | gzip \u003e /path/to/backup.gz`\n\nThen put the SD Card back in the Raspberry Pi and plug it back on.\n\nYour backuped image file is now safe on your computer.\nIf you want to get back to it, you only have to burn that image to a microSD card with Etcher, following the step 1.\nOr you can use the `dd` command and just swap the `if` (input file), and `of` (output file) parameters:\n`sudo dd if=/path/to/backup.img of=/dev/rdisk1 bs=1m`\n\u003c!-- anchor --\u003e\n\n### 6. Install Synchting \n\n\u003c!-- anchor --\u003e\n@import \"InstallSyncthing.md\" \n\u003c!-- anchor --\u003e\n\n### 7. Configure Syncthing\n\n\u003c!-- anchor --\u003e\n\n\u003c!-- anchor --\u003e\n\n\u003ccenter\u003e\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\nReleased under the \u003ca href=\"LICENSE.md\"\u003eRémi Lavedrine License\u003c/a\u003e\u003cbr\u003e\nCopyright © 2017 Rémi Lavedrine\u003cbr\u003e\n:man_technologist:  with  :heart:  in Paris :fr:\n\u003c/center\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshosta%2Fsyncthing-on-raspberry-pi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshosta%2Fsyncthing-on-raspberry-pi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshosta%2Fsyncthing-on-raspberry-pi/lists"}