|
|
3 weeks ago | |
|---|---|---|
| .github | 1 month ago | |
| app | 1 month ago | |
| heroku | 3 years ago | |
| koyeb | 2 years ago | |
| libs | 1 month ago | |
| logs | 4 years ago | |
| resources | 2 years ago | |
| tests | 1 month ago | |
| vendor | 1 month ago | |
| .dockerignore | 1 month ago | |
| .env.example | 1 year ago | |
| .gitattributes | 3 years ago | |
| .gitignore | 1 month ago | |
| CHANGELOG.md | 3 weeks ago | |
| Dockerfile | 1 month ago | |
| Dockerfile.heroku | 1 month ago | |
| Dockerfile.koyeb | 1 month ago | |
| LICENSE | 4 years ago | |
| Makefile | 2 years ago | |
| README.md | 3 weeks ago | |
| README_ZH.md | 1 month ago | |
| app.json | 3 years ago | |
| common.yml | 2 years ago | |
| composer.json | 1 month ago | |
| composer.lock | 1 month ago | |
| config.php | 2 years ago | |
| docker-compose.yml | 1 year ago | |
| docker-entrypoint.sh | 3 years ago | |
| heroku.yml | 3 years ago | |
| index.php | 1 month ago | |
| phpunit.xml.dist | 1 month ago | |
| run | 1 month ago |
🍭 What Notifications Look Like
📪 Configure Notifications (Email / Telegram Bot / WeCom / ServerChan / Bark / Pushplus)
🐳 Docker Deployment (recommended, and usually the simplest option)
📦 Koyeb Deployment (a good fit if you do not have your own server)
🧪 Mogenius Deployment (no longer viable)
☁ Cloud Function Deployment (no longer actively supported)
Freenom Renewal Bureau for discussion, testing, and feedback. You can join directly here: https://t.me/freenom_auto_renewFreenom is the only provider I know of that offers free top-level domains, but those domains have to be renewed every year, and only one year at a time. I had a pile of domains registered at different times, and renewing them manually got old fast, so I wrote this script to automate the whole thing.
The script sends a notification whether renewal succeeds, fails, or crashes. Renewal-related notifications also include details like how many days remain before an unrenewed domain expires. The screenshot below shows the email version of that message.
Debian is the easiest path. If you deploy without Docker, you need PHP 8.1 or newer. If you do not have a server, the hosted options later in this README may be a better fit.Gmail, QQ Mail, 163 Mail, and Outlook. If you want to use another provider or your own mail server, check the email-related comments in .env.example.Telegram Bot, WeCom, ServerChan, Bark, and Pushplus. You only need MAIL_USERNAME, MAIL_PASSWORD, and TO if you choose email notifications.This project supports Email, Telegram Bot, WeCom, ServerChan, Bark, and Pushplus. Pick one and configure only that path. If you are on iOS, Bark is usually the cleanest option. For most other users, use whichever channel you are already comfortable with. I generally do not recommend ServerChan: the daily message cap is restrictive, and some content is hidden behind its paid tier. The same basic setup effort usually goes further with WeCom, and those notifications show up directly in the standard WeChat client.
Jump straight to a section:
This section covers Gmail, QQ Mail, and 163 Mail. Only read the provider you actually use. QQ Mail and 163 Mail both use your mailbox plus an authorization code. Gmail now effectively means your mailbox plus an app password.
(Click to expand or collapse each provider.)
After that, set MAIL_USERNAME and MAIL_PASSWORD to your mailbox and password or token, set TO to the mailbox that should receive notifications, and set MAIL_ENABLE=1 in .env.
If you do not want email notifications at all, set MAIL_ENABLE=0 in the root .env file.
That is it for email notifications.
For the full Telegram Bot setup flow, see the wiki: Telegram Bot
For the full WeCom setup flow, see the wiki: WeCom
For the full ServerChan setup flow, see the wiki: ServerChan
For the full Bark setup flow, see the wiki: Bark
Pushplus is also supported. Set PUSHPLUS_KEY to your token in .env, then set PUSHPLUS_ENABLE=1 to turn it on. If Pushplus is the only channel you want to use, leave the other notification methods disabled.
That covers notifications. Next up are the supported deployment options. Docker is still the path I recommend for most people because it removes nearly all environment drift.
Note: this path is currently marked beta and only supports amd64. If you are on arm or another architecture, wait for a later update. If you need a server, one option is cheap US VPS.
Debian / Ubuntu (recommended)
apt-get update -y;
apt-get install -y wget vim git make;
wget -qO- get.docker.com | bash;
systemctl start docker;
sudo systemctl enable docker.service;
sudo systemctl enable containerd.service;
docker version;
DOCKER_COMPOSE_VER=2.24.3;
DOCKER_CONFIG=/usr/local/lib/docker;
mkdir -p $DOCKER_CONFIG/cli-plugins;
curl -SL https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VER}/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose;
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose;
docker compose version;
CentOS
yum update -y;
yum install -y wget vim make;
wget -qO- get.docker.com | bash;
systemctl start docker;
sudo systemctl enable docker.service;
sudo systemctl enable containerd.service;
docker version;
DOCKER_COMPOSE_VER=2.24.3;
DOCKER_CONFIG=/usr/local/lib/docker;
mkdir -p $DOCKER_CONFIG/cli-plugins;
curl -SL https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VER}/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose;
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose;
docker compose version;
git clone https://github.com/luolongfei/freenom.git && cd freenom
English as the language, pick any name you want, set the app to Private, and create it.Management > Settings (https://wit.ai/apps/<App ID>/settings).Client Access Token and put it in .env as WIT_AI_KEY='your Client Access Token'..envReplace the sample values in .env with your own configuration. If you are upgrading from an older release, you can also copy your previous .env into the new project root and let the script update it for you. Field-by-field explanations live in .env.example.
cp .env.example .env;
vim .env;
When you are done, save and quit.
Run these commands from the directory that contains docker-compose.yml.
make up
That is the whole startup flow. Use make logs if you want to tail the live logs.
Start the stack or update to the latest version
make up
Stop the stack
make down
View live logs
make logs
Clean up disk space used by containers
make clear
Restart the containers
make restart
That is the end of the Docker Compose section.
If you have your own server, this is the deployment mode I recommend most.
Docker Hub: https://hub.docker.com/r/luolongfei/freenom
The image supports linux/amd64, linux/arm64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, and linux/arm/v6, so it should work on most VPS platforms as well as NAS devices and Raspberry Pi-class hardware.
root and run the one-line installerUpdate packages and install the basic tools first. Pick the command that matches your OS.
Debian / Ubuntu
apt-get update && apt-get install -y wget vim make
CentOS
yum update && yum install -y wget vim make
Then install Docker:
wget -qO- get.docker.com | bash
Notes:
Start the Docker service
systemctl start docker
Check Docker status
systemctl status docker
Enable Docker at boot
systemctl enable docker
Basic command:
docker run -d --name freenom --restart always -v $(pwd):/conf -v $(pwd)/logs:/app/logs luolongfei/freenom
If you want to set a custom run time:
docker run -d --name freenom --restart always -v $(pwd):/conf -v $(pwd)/logs:/app/logs -e RUN_AT="11:24" luolongfei/freenom
That command is identical except for -e RUN_AT="11:24", which tells the container to run the renewal task every day at 11:24 China Standard Time (Beijing time). RUN_AT also accepts cron-style expressions. For example, -e RUN_AT="9 11 * * *" means 11:09 China Standard Time every day. If you want to run less often than daily, change the cron expression accordingly.
I do not recommend setting a custom schedule unless you have a real reason to do it. If a large number of users all pick the same timestamp, everyone ends up hitting Freenom at once and service quality gets worse for everybody. If you leave RUN_AT unset, the container automatically chooses a random time between 06:00 and 23:00 China Standard Time, and it re-rolls that time on each restart.
After the container starts, run ls -a in the current directory and you should see a .env file plus a logs directory. logs stores runtime logs, and .env is the configuration file. Edit .env, replace the sample values with your own, save it, and restart the container. If the config is valid, you should start receiving notifications quickly.
How do I know whether my config is correct?
After you save
.env, rundocker restart freenom, wait about five seconds, then rundocker logs freenom. If the output includes a success message, your configuration is in good shape. If you have not configured email yet, disable mail delivery first.How do I upgrade to the latest version or redeploy from scratch?
From the directory that contains
.env, delete the existing container withdocker rm -f freenom, remove the old image withdocker rmi -f luolongfei/freenom, and run thedocker runcommand again. That redeploys the latest image. If the new release changes.env, the program will update the file and migrate your existing settings automatically.
One-line upgrade command:
docker rm -f freenom && docker rmi -f luolongfei/freenom && docker run -d --name freenom --restart always -v $(pwd):/conf -v $(pwd)/logs:/app/logs luolongfei/freenom
Show container status and size
docker ps -as
Show container logs
docker logs freenom
Restart the container
docker restart freenom
Stop the container
docker stop freenom
Remove the container
docker rm -f freenom
Show container CPU and memory usage
docker stats --no-stream
Show Docker version details
docker version
Restart Docker itself (not just the container)
systemctl restart docker
That wraps up the container deployment section.
Heroku ended its free tier on November 28, 2022, so this route is effectively dead. Official announcement: https://blog.heroku.com/next-chapter
If you still want the historical deployment guide, it lives in the wiki: Deploy via Heroku
Railway's pricing changes often. Whether it is a good long-running deployment target depends on the plan you are on and the current billing rules, so check the official docs before you deploy: Railway pricing, Railway plans.
The step-by-step Railway guide is in the wiki: Deploy via Railway
If you do not have your own server, Koyeb can still be a reasonable option. Free allowances and whether a card is required can change with Koyeb's plan policy, so check the current pricing before you deploy: Koyeb pricing.
The step-by-step Koyeb guide is in the wiki: Deploy via Koyeb
After you read that guide and you are comfortable with the setup, you can try the one-click deploy link here:
Mogenius removed its free plan, so this option is no longer usable. Background: discussion #208
All cloud-function targets use the same ZIP package, which was prepared for cross-platform compatibility: https://github.com/luolongfei/freenom/releases/download/v0.5.1/freenom_scf.zip
Cloud-function deployment is no longer actively maintained, so this historical package remains the reference artifact for this path.
After downloading it, place the ZIP anywhere convenient on your machine. The deployment flow for each provider uploads that ZIP directly.
This deployment style is no longer actively supported because the major platforms have moved to paid pricing, but the old wiki pages are still here if you need them:
The source-based deployment guide lives in the wiki: Deploy from Source
If you run into a bug, please open an issue and follow the template so the problem is easy to reproduce. If Freenom changes its algorithm and breaks the project, open an issue and let me know. I maintain this repository for the long haul, and stars are always appreciated.
Huge thanks to these supporters for backing the project.
If this project saves you time, consider supporting it. Support makes it much easier to keep maintaining and improving the codebase.
PayPal: https://www.paypal.me/mybsdc
Every time you spend money, you're casting a vote for the kind of world you want. -- Anna Lappe
If you leave a message with your donation, it will be shown on the Donation List.
Every star and every donation helps keep this project alive. Thank you to everyone who has supported it. Recommending the project to other people helps too. The more people use it, the easier it is to justify spending time on updates.
Believe in the future. Stay rational.
Taking things seriously is how we participate in society, and how we change it. -- Li Zhi
(If you have another implementation in a different language, feel free to open a PR and add it to this list.)