ソーシャルネットワーク · 4 min read · Dec 21, 2025
Ubuntu 22.04にFriendicaソーシャルネットワークプラットフォームをインストールする方法
Friendica(以前はFriendikaとして知られていた)は、オープンソースで分散型の通信プラットフォームであり、ウェブ上に独自のソーシャルネットワーキングプラットフォームを構築することを可能にします。これは、友人、知人、または単に同じ興味を持つ人々をメンバーのグループでつなげることを目的としています。これは、Mastodon、Twitter、Diasporaなどの他のソーシャルネットワークプラットフォームの代替ソリューションです。RSS/Atomフィードを介して、ウェブサイトやブログをソーシャルストリームにインポートすることができます。
このガイドでは、Ubuntu 22.04でApacheを使用してFriendicaソーシャルネットワークをインストールする方法を説明します。
前提条件
- Ubuntu 22.04を実行しているサーバー。
- 有効なドメイン名がサーバーのIPにポイントされています。
- サーバーにルートパスワードが設定されています。
始めに
まず、次のコマンドを使用してすべてのシステムパッケージを最新バージョンに更新およびアップグレードします:
apt update -y
apt upgradeすべてのパッケージが更新されたら、次のステップに進むことができます。
Apache、MariaDB、およびPHPのインストール
FriendicaはPHPで書かれており、データベースバックエンドとしてMySQLを使用しています。したがって、システムにLAMPサーバーをインストールする必要があります。次のコマンドを使用してインストールできます:
apt 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/8.1/apache2/php.ini次の行を変更します:
memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 300
max_input_vars = 1500
date.timezone = UTC
完了したら、ファイルを保存して閉じます。
MariaDBデータベースの設定
次に、Friendica用のデータベースとユーザーを作成する必要があります。まず、次のコマンドを使用してMySQLに接続します:
mysql完了したら、次のコマンドを使用してデータベースとユーザーを作成します:
MariaDB [(none)]> CREATE DATABASE friendica;
MariaDB [(none)]> CREATE USER 'friendica'@'localhost' IDENTIFIED BY 'password';次に、次のコマンドを使用してFriendicaデータベースにすべての権限を付与します:
MariaDB [(none)]> GRANT ALL ON friendica.* TO 'friendica'@'localhost' WITH GRANT OPTION;次に、権限をフラッシュし、次のコマンドを使用してMySQLから退出します:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;完了したら、次のステップに進むことができます。
Ubuntu 22.04にFriendicaをインストール
まず、GitリポジトリからFriendicaの最新バージョンをApacheのウェブルートディレクトリにダウンロードします:
cd /var/www/html
git clone https://github.com/friendica/friendica-addons.git -b stableダウンロードが完了したら、friendicaディレクトリに移動し、次のコマンドを使用して必要なPHP依存関係をインストールします:
cd friendica
./bin/composer.phar install --no-dev次に、次のコマンドを使用してFriendicaアドオンをダウンロードします:
git clone https://github.com/friendica/friendica-addons.git次に、アドオンディレクトリと.htaccessファイルの名前を変更します。
mv friendica-addons addon
mv .htaccess-dist .htaccess次に、friendicaディレクトリに適切な所有権と権限を設定します:
chown -R www-data:www-data /var/www/html/friendica/
chmod -R 755 /var/www/html/friendica/完了したら、次のステップに進むことができます。
Apacheバーチャルホストの作成
次に、FriendicaをホストするためのApacheバーチャルホスト設定ファイルを作成する必要があります。次のコマンドを使用して作成できます:
nano /etc/apache2/sites-available/friendica.conf次の行を追加します:
ServerAdmin [email protected]
DocumentRoot /var/www/html/friendica
ServerName friendica.linuxbuz.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 Wed 2022-12-21 10:33:18 UTC; 6s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 57027 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 57031 (apache2)
Tasks: 6 (limit: 2238)
Memory: 15.8M
CPU: 43ms
CGroup: /system.slice/apache2.service
??57031 /usr/sbin/apache2 -k start
??57032 /usr/sbin/apache2 -k start
??57033 /usr/sbin/apache2 -k start
??57034 /usr/sbin/apache2 -k start
??57035 /usr/sbin/apache2 -k start
??57036 /usr/sbin/apache2 -k start
Dec 21 10:33:18 ubuntu2204 systemd[1]: apache2.service: Deactivated successfully.
Dec 21 10:33:18 ubuntu2204 systemd[1]: Stopped The Apache HTTP Server.
Dec 21 10:33:18 ubuntu2204 systemd[1]: Starting The Apache HTTP Server...
この時点で、Apacheウェブサーバーはインストールされ、構成されています。次のステップに進むことができます。
Let’s Encrypt SSLのインストール
ウェブサイトをLet’s Encrypt SSLで保護することは常に良いアイデアです。SSLをインストールおよび管理するためにCertbotクライアントをインストールする必要があります。
まず、次のコマンドを使用してSnapパッケージマネージャーをインストールします:
apt install snapd次に、Snapパッケージを最新バージョンに更新します:
snap install core
snap refresh core次に、次のコマンドを使用してcertbotパッケージをインストールします:
snap install --classic certbot次に、Certbotバイナリのシンボリックリンクをシステムの場所に作成します:
ln -s /snap/bin/certbot /usr/bin/certbot次に、次のコマンドを実行してLet’s Encrypt SSL証明書をダウンロードおよびインストールします:
certbot --apacheサービス利用規約に同意し、有効なメールアドレスを提供するよう求められます。
Saving debug log to /var/log/letsencrypt/letsencrypt.log
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.3-September-21-2022.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, 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
Account registered.次に、Let’s Encrypt SSLをインストールしたいドメインを選択するよう求められます:
Which names would you like to activate HTTPS for?
We recommend selecting either all domains, or all domains in a VirtualHost/server block.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: friendica.linuxbuz.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
デフォルトのドメインを選択するには1を入力し、Enterキーを押してウェブサイトにSSLをインストールします。
Requesting a certificate for friendica.linuxbuz.com
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/friendica.linuxbuz.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/friendica.linuxbuz.com/privkey.pem
This certificate expires on 2023-03-21.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
Successfully deployed certificate for friendica.linuxbuz.com to /etc/apache2/sites-available/friendica-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on https://friendica.linuxbuz.com
We were unable to subscribe you the EFF mailing list because your e-mail address appears to be invalid. You can try again later by visiting https://act.eff.org.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Friendica Web UIにアクセス
今、ウェブブラウザを開き、URL https://friendica.linuxbuz.com を使用してFriendicaウェブインターフェースにアクセスします。システムチェックページにリダイレクトされます:


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

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

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

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

今、登録ページボタンをクリックします。次のページが表示されるはずです。

必要なすべての情報を提供し、今すぐサインアップボタンをクリックします。次のページにユーザー名とパスワードが表示されるはずです。

今、ウェブブラウザを開き、URL https://friendica.linuxbuz.com を使用してFriendicaのログインページにアクセスします。Friendicaのログインページが表示されるはずです。

ログインユーザー名、パスワードを提供し、ログインボタンをクリックします。次のページにFriendicaのダッシュボードが表示されるはずです。

結論
おめでとうございます!Ubuntu 22.04サーバーにFriendicaソーシャルネットワークプラットフォームを正常にインストールおよび構成しました。これで、中央の場所からソーシャルネットワークコミュニティを管理できます。質問があればお気軽にお尋ねください。
新しい投稿を受信箱で受け取る
スパムはありません。いつでも購読を解除できます。