EteSyncインストール · 6 min read · Sep 30, 2025

Ubuntu 20.04にEteSyncサーバーをインストールする方法

EteSyncは、連絡先、カレンダー、タスクを同期するためのオープンソースソリューションです。自己ホスト型で、エンドツーエンドの暗号化を提供し、他のユーザーとデータを共有することができます。GNOMEおよびKDEデスクトップと統合することができ、デスクトップ、ウェブ、Android、iOSクライアントを通じてアクセスできます。

このチュートリアルでは、Ubuntu 20.04でApacheを使用してEteSyncをインストールする方法を示します。

前提条件

  • Ubuntu 20.04を実行しているサーバー。
  • サーバーIPにポイントされた有効なドメイン名。
  • サーバーに設定されたルートパスワード。

始めに

まず、次のコマンドを実行してシステムパッケージを最新バージョンに更新します:

apt-get update -y

すべてのパッケージが更新されたら、次のステップに進むことができます。

MariaDBサーバーのインストール

デフォルトでは、EteSyncは情報を保存するためにSQLiteデータベースを使用します。ここでは、データベースバックエンドとしてMariaDBをインストールして使用します。

まず、次のコマンドを使用して必要な依存関係をインストールします:

apt-get install software-properties-common gnupg2 -y

次に、次のコマンドを使用してMariaDBのGPGキーとリポジトリを追加します:

apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8  
add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirror.lstn.net/mariadb/repo/10.5/ubuntu focal main'

次に、MariaDBリポジトリを更新し、次のコマンドで最新バージョンのMariaDBをインストールします:

apt-get install mariadb-server -y

MariaDBサーバーのインストールが完了したら、次のコマンドでMariaDBシェルにログインします:

mysql

ログインしたら、次のコマンドでEteSync用のデータベースとユーザーを作成します:

MariaDB [(none)]> create database etesync;  
MariaDB [(none)]> create user etesync@localhost identified by 'securepassword';

次に、次のコマンドでEteSyncデータベースにすべての権限を付与します:

MariaDB [(none)]> grant all privileges on etesync.* to etesync@localhost;

次に、権限をフラッシュし、次のコマンドでMariaDBから退出します:

MariaDB [(none)]> flush privileges;  
MariaDB [(none)]> exit;

作業が完了したら、次のステップに進むことができます。

EteSyncのインストールと設定

まず、EteSyncに必要なPythonの依存関係をいくつかインストールする必要があります。次のコマンドでそれらをすべてインストールできます:

apt-get install python3-virtualenv python3-pip gcc libmysqlclient-dev build-essential git -y

すべての依存関係をインストールしたら、次のコマンドを使用してEteSyncの最新バージョンをダウンロードします:

git clone https://github.com/etesync/server.git etesync

ダウンロードが完了したら、ディレクトリをetesyncに変更し、次のコマンドでPythonの仮想環境を作成します:

cd etesync  
virtualenv -p python3 .venv

次に、次のコマンドで仮想環境をアクティブにします:

source .venv/bin/activate

次に、次のコマンドで必要なすべての要件をインストールします:

pip install -r requirements.txt

次に、サンプル構成ファイルをコピーします:

cp etebase-server.ini.example etebase-server.ini

次に、以下のコマンドを使用して構成ファイルを編集します:

nano etebase-server.ini

次の行をあなたの設定に応じて追加または修正します:

media_root = /opt
allowed_host1 = etesync.example.com

;engine = django.db.backends.sqlite3
;name = db.sqlite3

engine = django.db.backends.mysql
name = etesync
user = etesync
password = securepassword
host = 127.0.0.1
port = 3306

ファイルを保存して閉じたら、次のコマンドで他のモジュールをインストールします:

pip3 install daphne  
pip3 install mysqlclient  
pip3 install aioredis

次に、次のコマンドで静的ファイルを生成し、データベースを移行します:

./manage.py collectstatic  
./manage.py migrate

最後に、次のコマンドでEteSyncサーバーを起動します:

daphne -b 0.0.0.0 -p 8001 etebase_server.asgi:application

すべてが正常であれば、次の出力が得られるはずです:

2021-07-09 05:42:28,510 INFO     Starting server at tcp:port=8001:interface=0.0.0.0
2021-07-09 05:42:28,510 INFO     HTTP/2 support not enabled (install the http2 and tls Twisted extras)
2021-07-09 05:42:28,511 INFO     Configuring endpoint tcp:port=8001:interface=0.0.0.0
2021-07-09 05:42:28,512 INFO     Listening on TCP address 0.0.0.0:8001

CTRL + Cを押してサーバーを停止します。

次に、次のコマンドを使用して管理ユーザーを作成します:

./manage.py createsuperuser

以下のように、ユーザー名、パスワード、メールアドレスを提供します:

Username: etesync
Email address: [email protected]
Password: 
Password (again): 
Superuser created successfully.

次に、次のコマンドでPythonの仮想環境から非アクティブにします:

deactivate

EteSyncのためのSystemdユニットファイルの作成

次に、EteSyncを管理するためのsystemdユニットファイルを作成する必要があります。次のコマンドで作成できます:

nano /etc/systemd/system/etesync.service

次の行を追加します:

[Unit]
Description=EteSync: End-to-End Encryption to Sync Calender, Contacts, Tasks and Notes.

[Service]
WorkingDirectory=/root/etesync
ExecStart=/root/etesync/.venv/bin/daphne -b 127.0.0.1 -p 8001 -u /tmp/etebase_server.sock etebase_server.asgi:application
User=root
Group=root
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target

ファイルを保存して閉じたら、次のコマンドでsystemdデーモンをリロードして構成変更を適用します:

systemctl daemon-reload

次に、次のコマンドでEteSyncサービスを開始および有効にします:

systemctl start etesync  
systemctl enable etesync

EteSyncサービスのステータスを確認するには、次のコマンドを実行します:

systemctl status etesync

次の出力が得られるはずです:

? etesync.service - EteSync: End-to-End Encryption to Sync Calender, Contacts, Tasks and Notes.
     Loaded: loaded (/etc/systemd/system/etesync.service; disabled; vendor preset: enabled)
     Active: active (running) since Fri 2021-07-09 05:45:45 UTC; 5s ago
   Main PID: 16213 (daphne)
      Tasks: 1 (limit: 2353)
     Memory: 48.7M
     CGroup: /system.slice/etesync.service
             ??16213 /root/etesync/.venv/bin/python /root/etesync/.venv/bin/daphne -b 127.0.0.1 -p 8001 -u /tmp/etebase_server.sock etebase_se>

Jul 09 05:45:45 node1 systemd[1]: Started EteSync: End-to-End Encryption to Sync Calender, Contacts, Tasks and Notes..
Jul 09 05:45:46 node1 daphne[16213]: 2021-07-09 05:45:46,993 INFO     Starting server at tcp:port=8001:interface=127.0.0.1, unix:/tmp/etebase_>
Jul 09 05:45:46 node1 daphne[16213]: 2021-07-09 05:45:46,995 INFO     HTTP/2 support not enabled (install the http2 and tls Twisted extras)
Jul 09 05:45:46 node1 daphne[16213]: 2021-07-09 05:45:46,995 INFO     Configuring endpoint tcp:port=8001:interface=127.0.0.1
Jul 09 05:45:46 node1 daphne[16213]: 2021-07-09 05:45:46,997 INFO     Listening on TCP address 127.0.0.1:8001
Jul 09 05:45:46 node1 daphne[16213]: 2021-07-09 05:45:46,998 INFO     Configuring endpoint unix:/tmp/etebase_server.sock

この時点で、EteSyncは起動し、ポート8001でリッスンしています。次のステップに進むことができます。

Apacheをリバースプロキシとして設定する

EteSyncにアクセスするために、Apacheをリバースプロキシとしてインストールして使用することをお勧めします。まず、次のコマンドでApacheサーバーをインストールします:

apt-get install apache2 -y

Apacheサーバーをインストールした後、次のコマンドですべてのプロキシモジュールを有効にします:

a2enmod proxy proxy_http headers proxy_wstunnel

次に、新しいApache仮想ホスト構成ファイルを作成します:

nano /etc/apache2/sites-available/etesync.conf

次の行を追加します:


   ServerName etesync.example.com
   ErrorDocument 404 /404.html

   ErrorLog ${APACHE_LOG_DIR}/etebase_error.log
   CustomLog ${APACHE_LOG_DIR}/etebase_access.log combined

   ProxyPreserveHost On
   ProxyPass / http://127.0.0.1:8001/
   ProxyPassReverse / http://127.0.0.1:8001/
   Alias /static /etesync/static

ファイルを保存して閉じたら、次のコマンドでApache仮想ホストを有効にします:

a2ensite etesync.conf

次に、次のコマンドでApacheを再起動して変更を更新します:

systemctl restart apache2

次のコマンドを使用してApacheのステータスを確認できます:

systemctl status apache2

次の出力が得られるはずです:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2021-07-09 05:50:26 UTC; 5s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 17551 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 17567 (apache2)
      Tasks: 55 (limit: 2353)
     Memory: 5.3M
     CGroup: /system.slice/apache2.service
             ??17567 /usr/sbin/apache2 -k start
             ??17568 /usr/sbin/apache2 -k start
             ??17569 /usr/sbin/apache2 -k start

Jul 09 05:50:26 node1 systemd[1]: Starting The Apache HTTP Server...
Jul 09 05:50:26 node1 apachectl[17558]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 45.58.3>

EteSync管理コンソールにアクセスする

今、ウェブブラウザを開き、URL http://etesync.example.com/admin/を使用してEteSync管理インターフェースにアクセスします。次のページにリダイレクトされます:

EteSyncログイン

管理ユーザー名、パスワードを提供し、サインインボタンをクリックします。次のページが表示されるはずです:

サイト管理

Let’s Encrypt SSLでEteSyncを保護する

まず、ドメインのSSL証明書をダウンロードしてインストールするために、Certbot Let’s Encryptクライアントをインストールする必要があります。

次のコマンドでインストールできます:

apt-get install python3-certbot-apache -y

インストールが完了したら、次のコマンドを実行して、ドメインetesync.example.comのLet’s Encrypt証明書をインストールします。

certbot --apache -d etesync.example.com

インストール中に、メールアドレスを提供し、以下のようにサービス利用規約に同意するよう求められます:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for etesync.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/etesync-le-ssl.conf
Deploying Certificate to VirtualHost /etc/apache2/sites-available/etesync-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/etesync-le-ssl.conf

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

次に、2を入力してEnterを押して、ドメインの無料SSL証明書をダウンロードしてインストールします。インストールが正常に完了すると、次の出力が得られるはずです:

Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/etesync.conf to ssl vhost in /etc/apache2/sites-available/
etesync-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://etesync.example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=etesync.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

結論

おめでとうございます!あなたは、Let’s Encrypt SSLを使用してUbuntu 20.04サーバーにEteSyncを正常にインストールしました。これで、EteSyncを使用してカレンダーや連絡先を簡単に同期できます。

Share: X/Twitter LinkedIn

新しい投稿を受信箱で受け取る

スパムはありません。いつでも購読を解除できます。