{"id":13725288,"url":"https://github.com/rafalp/misago_docker","last_synced_at":"2025-07-24T21:33:20.013Z","repository":{"id":54147040,"uuid":"129555949","full_name":"rafalp/misago_docker","owner":"rafalp","description":"Setup Misago forum on your server with HTTPS and backups in 15 minutes with minimal effort.","archived":false,"fork":false,"pushed_at":"2025-03-15T09:32:04.000Z","size":2397,"stargazers_count":48,"open_issues_count":5,"forks_count":33,"subscribers_count":4,"default_branch":"v1","last_synced_at":"2025-04-02T12:09:11.545Z","etag":null,"topics":["docker","docker-compose","forum","misago"],"latest_commit_sha":null,"homepage":"https://misago-project.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rafalp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2018-04-14T21:31:48.000Z","updated_at":"2025-03-27T16:30:48.000Z","dependencies_parsed_at":"2023-11-20T21:29:02.187Z","dependency_job_id":"626978db-280c-4e90-88d2-7c88f2bda90e","html_url":"https://github.com/rafalp/misago_docker","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalp%2Fmisago_docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalp%2Fmisago_docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalp%2Fmisago_docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalp%2Fmisago_docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafalp","download_url":"https://codeload.github.com/rafalp/misago_docker/tar.gz/refs/heads/v1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045231,"owners_count":21038553,"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","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":["docker","docker-compose","forum","misago"],"created_at":"2024-08-03T01:02:18.248Z","updated_at":"2025-04-09T13:06:41.032Z","avatar_url":"https://github.com/rafalp.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"Misago Docker\n=============\n\nThis repository provides a production-ready setup of Misago for people who:\n\n- Want to run their own forum using Misago.\n- Have a server with 1GB of RAM and Docker available.\n- Have basic knowledge of Linux to SSH to a VPS, navigate the file system, modify files, run programs, and follow instructions from guides.\n\nIt sets up Misago forum running on Python 3.12 behind an NGINX reverse proxy with HTTPS enabled using Let's Encrypt. It uses PostgreSQL for the database and Redis for caching and messaging. Celery is included for task queue functionality.\n\nTo help you with running your site, the repository includes a tool called `appctl` that provides shortcuts for common actions and wizards for configuration management, eliminating the need for manual file editing.\n\n**Note for DevOps pros:** This repository assumes that users will clone it onto their servers using `git clone`, run `./appctl setup` for basic configuration, and run all necessary services in Docker Compose with data stored on the server using Docker volumes. This approach is compatible with setups where services run on dedicated instances or services like Amazon S3 or RDS. The goal of this repository is to make Misago a viable option for hobbyists and small/medium communities, rather than enterprise deployments that require massive scalability to serve a large number of active users simultaneously.\n\nSetup\n-----\n\nFor a complete step-by-step setup guide, please refer to [the documentation](https://misago.gitbook.io/docs/setup).\n\nTo start your own Misago site, you will need:\n\n- A server running Linux with Docker, Compose plugin and at least 1GB of memory (DigitalOcean droplets are a recommended option).\n- A domain configured to point to your server.\n\n\n### Getting code on a server\n\n`ssh` to your server. If you are on Windows, you can use [PuTTY](https://www.putty.org/). Next, clone this repo using the following command:\n\n```\ngit clone https://github.com/rafalp/misago_docker.git --depth=1\n```\n\nThis will create `misago_docker` directory that you can then `cd` to and continue site setup.\n\n\n### Running the setup\n\nEnter the misago_docker directory and run `./appctl setup` command. The wizard will let you set basic settings for your site: your domain name, timezone or first admin account details. After that it will:\n\n- Install all the requirements.\n- Build Docker containers.\n- Setup `crontab` that will run daily maintenance.\n- Create database and populate it with initial data.\n\nWhen `setup` finishes, visit your domain in order to see your Misago forum running.\n\nLastly, go to `https://yourdomain.com/admincp/` and log into the admin panel using the username and password you entered during the setup. There you will be able to further configure your forum. For instance: set forum name, create categories and such.\n\n\n### Secure your server\n\nDepending on initial configuration of your server, you may have to take [additional steps](https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04) to make it more secure. Internet is patrolled by bots searching for vulnerable servers attempting to brute-force root accounts so you should disable the root login, block IP addresses upon repeated failed authentication attempts, or both. You can easilly enable 10-minute ban for 3 failed sign-in entries by installing `fail2ban`:\n\n```\napt-get install fail2ban\n```\n\n\n### Setup e-mail\n\nIf you haven't done so during installation, you *really* should enable e-mails on your site. Not enabling e-mails doesn't mean that Misago will fallback to some other messaging mechanism. It will simply discard all messages without attempting to connect to any e-mail sending service.\n\nWithout e-mails enabled your users will not be able to receive activation e-mails, notifications, confirm password changes or reset forgotten passwords.\n\n\n### Enable Sentry\n\nYou can also create account on Sentry (https://sentry.io) and enable it on your site using `./appctl sentry`. Sentry provides fancy web interface for browsing Misago's logs, and will send you e-mail with notifications when your users experience errors or edit their profile details, which is possible source of forum spam.\n\n\n### Speed up Redis\n\nMisago uses Redis for caching and tasks queue. To get most performance out of it, you will have to make sure that you have `Transparent Huge Pages (THP)` support disabled in your kernel. To do that run the command `echo never \u003e /sys/kernel/mm/transparent_hugepage/enabled` as root, and add it to your `/etc/rc.local` in order to retain the setting after a reboot. Docker Redis container must be restarted after THP is disabled, but you can simply run `./appctl restart` for same effect.\n\n\nUpgrading to newer version\n--------------------------\n\nTo upgrade to newer version, go to `misago_docker` directory and run `./apctl upgrade`. This will backup your data, get latest code from github, rebuild Docker containers and update Misago (and other services) to latest minor releases.\n\nYou may have to setup git credentials on your machine for `git pull` to work, but entering git password is not required.\n\n\nBackup and restore\n------------------\n\n### Creating new backup\n\nRunning the `./appctl backup` will result in new backup being created in `backups` directory.\n\nBackup will be a `tar.gz` archive named following the `manual-YYYYMMDDHHMMSS.tar.gz` format and will contain `database.sql` file with database export created using `pg_dump`, and `media` directory containing user-uploaded files.\n\n\n### Restoring from backup\n\nYou can restore your site's data by placing the backup archive in the `backups` directory, and running `./appctl restore yourbackupfile.tar.gz`. If your backup file is located in the subdirectory, you can specify the path to it relative to `backups`, eg.: `./appctl restore 2018/10/yourbackupfile.tar.gz`.\n\nRestoration will:\n\n- overwrite your current `media` directory with one from archive.\n- load the `database.sql` to `psql`, overwriting existing database tables with ones from file.\n\n**NOTE:** because restoration process can be considered destructive, you should backup existing data if you are restoring the site that has any data you may want to recover if something goes wrong.\n\nAfter you've restored from backup, it's good idea to follow up with `./appctl rebuild` to rebuild Misago image, giving it's application container a chance to rebuild filesystem caches.\n\n\n### Daily backup\n\n`./appctl` adds daily backup to system cron. This backup is ran *before* all other maintenance tasks, providing fallback point in case that maintenance deletes something you **really** didn't want to delete. Automatic backup files start with `auto-` and are deleted automatically after 10 days.\n\n\n### Creating custom backup archives\n\nYou can create your own backup archives for use with `./appctl restore`.\n\nStart off with creating a directory, `mybackup` for instance. Create the following files and directories inside of it:\n\n`database.sql` - PostgreSQL dump that can be imported with `psql`.\n`media` - your forum's media directory.\n\nYour ready backup should look like this:\n\n```\nmybackup\n  - media\n  - database.sql\n```\n\nNow run `tar -zcf mybackup.tar.gz mybackup`. This will produce the `mybackup.tar.gz` file that you can put in `backups` directory and restore with `./appctl restore mybackup.tar.gz`. \n\n\nCustomizing site\n----------------\n\nInside `misago/theme` directory you will find two folders that allow you to customise your site's looks:\n\n`static` for overriding/adding static files such as css, js, images or fonts.\n`templates` for overriding Django templates with custom ones.\n\n\n### Example: Replacing Misago's css with custom one\n\n\u003e You may want to use *themes* feature available in admin control panel instead.\n\nLet's say you've cloned [main repo](https://github.com/rafalp/Misago) to your dev machine. Got it running and customised the CSS to make your site's theme dark instead of default. You've ran build script and got final `misago.css` file containing your changes. How do you now deploy this file to production?\n\nFirst, you need to find out the path of the original file relative to its `static` directory. In case of Misago this is `static/misago/css/misago.css`. This means that to make Misago use your file instead of default, it should be deployed to `theme/static/misago/css/misago.css` original.\n\nAfter deploying your new file, run `./appctl collectstatic` to make Misago \"collect\" this file and replace default with it.\n\n\n### Sticking a fork into the repo\n\nIf you are familiar with Python/Django applications or Docker images involved and wish to customise your setup further, please feel free to branch off/fork the repo - it's simple enough that merging eventual changes from upstream shouldn't be much of an issue.\n\n\nOverriding configuration\n------------------------\n\nTo override configuration in `docker-compose.yml`, create `docker-compose.override.yml` file next to it, and re-define selected parts in it. For example, to change default HTTP for NGINX proxy from 80 to 8080, you can include following configuration in your override:\n\n```yml\nversion: '3.0'\nservices:\n\n  nginx-proxy:\n    ports:\n      - \"8080:80\"\n```\n\nTo add or change settings defined in `settings.py` that don't support change via environment variable, you can create additional file `settings_override.py` next to it:\n\n```python\nSESSION_COOKIE_NAME = \"myforumsid\"\n```\n\nTo add custom urls to the site, create `urls_override.py` file that contains custom `urlpatterns`:\n\n```python\nfrom django.conf.urls import include\n\nurlpatterns = [\n    url(r\"^my-app/\", include(\"myapp.urls\")),\n]\n```\n\nBecause `urlpatterns` defined in override are checked before default ones, this approach supports overriding already-existing urls.\n\n\nDirectories\n-----------\n\n### `/backups`\n\nContains backups created by `./appctl backup` and loadable by `./appctl restore BACKUPNAME`.\n\n\n### `/config`\n\nThis directory contains configuration for Misago and PostgreSQL containers as well as Nginx config.\n\n\n### `/logs`\n\nLog files created by Misago container. If you are experiencing errors, see `misago.log` or `uwsgi.log` file contents for complete error message together with backtrace.\n\n\n### `/misago`\n\nDefines Docker container for Misago complete with UWSGI server running Misago and serving its static files.\n\n\n### `/nginx-proxy`\n\nExtends [jwilder/nginx-proxy](https://github.com/jwilder/nginx-proxy) Docker image to disable TLSv1.0 https encryption on your site, improving it's security rating.\n\n\n### `/wizard`\n\nPython scripts that `./appctl` runs when it needs to create or change `.env` files with configuration.\n\n\nConserving disk space\n---------------------\n\nDocker overhead on CPU and memory is negligible, but same can't be said about its disk usage. `./appctl` tries to cleanup whenever possible, but to be safe you will have to monitor amount of free space left on your server, and clean up once in a while using commands like `docker compose image prune`, manually emptying older logs and backups stored in `logs` and `backups` directories.\n\nDefault cron task will also try to delete log files older than 60 days.\n\n\nNeed help?\n----------\n\nIf you have problems setting up your site using `misago_docker`, feel free to ask on [our forums](https://misago-project.org/c/docker/27/) or [Discord Chat](https://discord.gg/fwvrZgB). Please don't use Github issues!\n\n\nContributing\n------------\n\nIf you've found a bug, issue, or place for improvement, please open an issue or pull request.\n\n\nCopyright and license\n---------------------\n\nThis is free software and you are welcome to modify and redistribute it under the conditions described in the license.\nFor the complete license, refer to LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafalp%2Fmisago_docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafalp%2Fmisago_docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafalp%2Fmisago_docker/lists"}