Friendicaインストール · 5 min read · Dec 21, 2025
Ubuntu 20.04にFriendicaソーシャルネットワークプラットフォームをインストールする方法

Friendicaは、独自のソーシャルネットワーキングプロジェクトを構築および維持するのに役立つ無料のオープンソースで分散型のソーシャルネットワーキングプラットフォームです。Mastodon、Hubzilla、OStatus、Pleromaなどを含むActivityPubのサポートが組み込まれています。RSS/Atomフィードを介してウェブサイトやブログをソーシャルストリームにインポートすることができます。どのデバイスからでもソーシャルネットワークを管理するのに役立つ強力なユーザーおよび管理者ダッシュボードを提供します。
このチュートリアルでは、Ubuntu 20.04にApacheとLet’s Encrypt SSLを使用してFriendicaをインストールする方法を示します。
前提条件
- Ubuntu 20.04を実行しているサーバー。
- サーバーIPにポイントされた有効なドメイン名。
- サーバーに設定されたルートパスワード。
始めに
始める前に、システムパッケージを最新バージョンに更新する必要があります。次のコマンドを使用して更新できます:
apt-get update -yサーバーが更新されたら、次のステップに進むことができます。
LAMPサーバーのインストール
Friendicaは、PHPで書かれたウェブサーバー上で動作し、データベースバックエンドとしてMySQLを使用します。したがって、LAMPスタックをシステムにインストールする必要があります。インストールされていない場合は、次のコマンドを使用してインストールできます:
apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-gmp php-curl php-intl php-mbstring php-xmlrpc php-mysql php-gd php-imagick php-xml php-cli php-zip php-sqlite3 curl git -yすべてのパッケージがインストールされたら、php.iniファイルを編集していくつかの変更を加えます:
nano /etc/php/7.4/apache2/php.ini次の行を変更します:
memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 300
max_input_vars = 1500
date.timezone = Asia/Kolkata完了したら、ファイルを保存して閉じます。
Friendicaデータベースの作成
次に、Friendica用のデータベースとユーザーを作成する必要があります。まず、次のコマンドでMySQLに接続します:
mysql接続したら、次のコマンドでデータベースとユーザーを作成します:
MariaDB [(none)]> CREATE DATABASE friendicadb;
MariaDB [(none)]> CREATE USER 'friendica'@'localhost' IDENTIFIED BY 'password';次に、次のコマンドでFriendicaデータベースにすべての権限を付与します:
MariaDB [(none)]> GRANT ALL ON friendicadb.* TO 'friendica'@'localhost' WITH GRANT OPTION;次に、権限をフラッシュし、次のコマンドでMySQLから退出します:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;完了したら、次のステップに進むことができます。
Friendicaのダウンロード
Friendicaをダウンロードする前に、システムにComposerをインストールする必要があります。次のコマンドでインストールできます:
apt-get install composer -yインストールが完了したら、Apacheのウェブルートにディレクトリを変更し、GitリポジトリからFriendicaの最新バージョンをダウンロードします:
cd /var/www/html
git clone https://github.com/friendica/friendica.gitダウンロードが完了したら、friendicaディレクトリに変更し、次のコマンドで必要なPHP依存関係をインストールします:
cd friendica
composer install --no-dev次に、次のコマンドでFriendicaアドオンをダウンロードします:
git clone https://github.com/friendica/friendica-addons.git次に、friendicaディレクトリに適切な所有権と権限を設定します:
chown -R www-data:www-data /var/www/html/friendica/
chmod -R 755 /var/www/html/friendica/完了したら、次のステップに進むことができます。
FriendicaのためのApacheの設定
次に、FriendicaをホストするためのApache仮想ホスト設定ファイルを作成する必要があります。次のコマンドで作成できます:
nano /etc/apache2/sites-available/friendica.conf次の行を追加します:
ServerAdmin [email protected]
DocumentRoot /var/www/html/friendica
ServerName friendica.example.com
Options +FollowSymlinks
AllowOverride All
Require all granted
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ファイルを保存して閉じたら、次のコマンドでApacheの仮想ホストとリライトモジュールを有効にします:
a2ensite friendica.conf
a2enmod rewrite次に、変更を適用するために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 Sun 2021-02-07 09:20:58 UTC; 6s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 33243 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 33259 (apache2)
Tasks: 6 (limit: 2353)
Memory: 15.1M
CGroup: /system.slice/apache2.service
??33259 /usr/sbin/apache2 -k start
??33260 /usr/sbin/apache2 -k start
??33261 /usr/sbin/apache2 -k start
??33262 /usr/sbin/apache2 -k start
??33263 /usr/sbin/apache2 -k start
??33264 /usr/sbin/apache2 -k start
Feb 07 09:20:58 ubuntu2004 systemd[1]: Starting The Apache HTTP Server...Friendicaダッシュボードにアクセス
今、ウェブブラウザを開いて、URL http://friendica.example.comを使用してFriendicaのウェブインターフェースにアクセスします。システムチェックページにリダイレクトされます:

すべてのPHP依存関係がインストールされていることを確認し、次へボタンをクリックします。次のページが表示されるはずです:

ドメイン名、インストールパスを提供し、送信ボタンをクリックします。次のページが表示されるはずです:

データベース名、データベースユーザー名、パスワードを提供し、送信をクリックします。サイト設定ページが表示されるはずです:

管理者のメールアドレス、言語、タイムゾーンを提供し、送信ボタンをクリックします。インストールが完了すると、次のページが表示されるはずです:

今、登録ページボタンをクリックして、Friendicaにアクセスするための登録プロセスを完了します。
Let’s Encrypt SSLでFriendicaを保護
ウェブサイトをLet’s Encrypt SSLで保護することは常に良いアイデアです。SSLをインストールおよび管理するためにCertbotクライアントをインストールする必要があります。次のコマンドでインストールできます:
apt-get install python3-certbot-apache -yCertbotがインストールされたら、次のコマンドを実行してLet’s Encrypt SSLでウェブサイトを保護します:
certbot --apache -d friendica.example.comメールアドレスを提供し、以下のようにサービス利用規約に同意するように求められます:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
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
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for friendica.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/friendica-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/friendica-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/friendica-le-ssl.conf次に、以下のようにHTTPトラフィックをHTTPSにリダイレクトするかどうかを選択します:
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): 22を入力してEnterを押して、ウェブサイトのLet’s Encrypt SSLをインストールします:
Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/friendica.conf to ssl vhost in /etc/apache2/sites-available/friendica-le-ssl.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://friendica.example.com
You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=friendica.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/friendica.example.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/friendica.example.com/privkey.pem
Your cert will expire on 2020-10-23. To obtain a new or tweaked
version of this certificate in the future, simply run certbot again
with the "certonly" option. To non-interactively renew *all* of
your certificates, run "certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le今、URL https://friendica.example.comを使用して、安全にウェブサイトにアクセスできます。
結論
おめでとうございます!Ubuntu 20.04サーバーにFriendicaソーシャルネットワークプラットフォームを正常にインストールおよび構成しました。これで、中央の場所からソーシャルネットワークコミュニティを管理できます。
新しい投稿を受信箱で受け取る
スパムはありません。いつでも購読を解除できます。