用Mastodon搭建自己的Twitter

简介

  • Mastodon是一款‘去中心化’的开源社交软件,类似Twitter和新浪微博

  • 可以建立独立节点,也可以跨节点交流

机器环境

  • CentOS7

  • Docker 18.06.1-ce

  • Docker-compose 1.22

  • Git

  • Nginx

下载项目代码

cd /home/
git clone https://github.com/tootsuite/mastodon.git live
cd live
chown -R 991:991 public

编辑 docker-compose.yml

拉取镜像

配置域名/数据库/邮件系统/管理员账户

配置Nginx

  • vi /etc/nginx/conf.d/mysite.conf

  • 只需修改root为代码的目录即可,其它地方都不用改

  • 启动Nginx:nginx -c /etc/nginx/nginx.conf

启动Mastodon

  • 启动后访问:https://192.168.88.104 (注意这里为之前设置的域名)

常见问题

  • 不能上传图片:

    • 必须保证/live/public/system的所属组是991

效果预览

Last updated