Bookmark

Chạy Actual Budget bằng Docker

Actual Budget là công cụ tài chính local-first viết bằng NodeJS, có khả năng đồng bộ thay đổi giữa các thiết bị. Quy trình này chạy server bằng Docker, giữ config.json và data ở các thư mục riêng, rồi khởi tạo mật khẩu quản trị trên web.1

Youtube video player

Video chính thức của i12bretro được giữ qua player YouTube; tôi không download hoặc rehost video.2

Cài Docker

Đăng nhập Linux bằng tài khoản có quyền sudo và chạy:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# install prerequisites
sudo apt install apt-transport-https ca-certificates git curl software-properties-common gnupg-agent -y
# add docker gpg key
curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -
# add docker software repository
sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"
# install docker
sudo apt install docker-ce docker-compose containerd.io -y
# enable and start docker service
sudo systemctl enable docker && sudo systemctl start docker
# add the current user to the docker group
sudo usermod -aG docker $USER
# reauthenticate for the new group membership to take effect
su - $USER

apt-key đã deprecated trên distro mới; hãy đối chiếu Docker docs trước khi dùng lệnh cũ.1

Chạy Actual

  1. Tạo thư mục, tạo config.json rỗng, đặt quyền và chạy container:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# create working directories
mkdir ~/docker/actualbudget/data -p
# create config.json
touch ~/docker/actualbudget/config.json
# write empty config file
echo "{}" > ~/docker/actualbudget/config.json
# set owner of working directories
sudo chown "$USER":"$USER" ~/docker -R
# allow the container to write to working directories
sudo chmod a+rwx -R ~/docker/actualbudget
# run actual budget container
docker run -d --name actualbudget -p 5006:5006 -v ~/docker/actualbudget/config.json:/app/config.json -v ~/docker/actualbudget/data:/data --restart=unless-stopped actualbudget/actual-server
  1. Mở http://DNSorIP:5006.
  2. Bấm Advanced Options.
  3. Tick I understand the risks, rồi bấm Open Actual.
  4. Nhập và xác nhận admin password riêng.
  5. Bấm Start Fresh.
  6. Kiểm tra giao diện Actual.1

Backup và kiểm tra

Backup cả ~/docker/actualbudget/config.json~/docker/actualbudget/data trước khi đổi image. Không expose cổng 5006 thẳng ra Internet; dùng reverse proxy HTTPS và firewall nếu truy cập từ ngoài LAN.1

Nguồn và video

Nguồn


  1. https://i12bretro.github.io/tutorials/0969.html — Run Actual Budget - Open Source Finance Management - in Docker (i12bretro) ↩︎ ↩︎ ↩︎ ↩︎

  2. https://www.youtube.com/watch?v=LOsnghXY3uU — Run Actual Budget - Open Source Finance Management - in Docker (official video) ↩︎


0 Bình luận

Góp Ý / Bình Luận / Đánh giá