<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/ DTD/wml_1.1.xml">

<wml>
<head>
<meta http-equiv="cache-control" content="max-age=180,private" />
</head>
<card title="Alpine 中安装 1Panel 面板">
<p>
作者:<a href="index.php?action=showuser&amp;userid=1&amp;hash=">admin</a><br />时间:2026-03-31 09:51<br />分类:<a href="index.php?action=list&amp;cid=3&amp;hash=">电脑技术</a><br />内容:
Alpine 中安装 1Panel 面板




Alpine直接安装1Panel面板会提示系统不支持，但是1Panel面板 其实就是docker运行的，故可以手动安装docker组件，解决系统程序问题后，就可以直接安装1Panel面板了。


1.修改为国内源

XML/HTML代码


    sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories

    sed -i 's/#http/http/g' /etc/apk/repositories

    apk update &amp;&amp; apk upgrade









2.安装一些必要的组件

XML/HTML代码


    apk add bash curl nano docker docker-cli-compose

    rc-service docker start

    rc-update add docker









3.将 systemctl 转译为 OpenRC，保存


nano /usr/local/bin/systemctl

XML/HTML代码


    #!/bin/sh

    action=${1}

    service=$(echo ${2} | sed 's/\.\(service\|socket\)//g')

    # Helper function to print usage

    print_usage() {

    echo &quot;Unsupported systemctl command: ${action}&quot;

    echo &quot;Supported commands: start, stop, restart, reload, status, enable, disable, is-enabled, is-active, show, list-units&quot;

    exit 1

    }

     

    case &quot;${action}&quot; in

    start)

    rc-service &quot;${service}&quot; start

    ;;

    stop)

    rc-service &quot;${service}&quot; stop

    ;;

    restart)

    rc-service &quot;${service}&quot; restart

    ;;

    reload)

    rc-service &quot;${service}&quot; reload || echo &quot;Service ${service} does not support reload; attempting restart&quot; &amp;&amp; rc-service &quot;${service}&quot; restart

    ;;

    daemon-reload)

    return 0

    ;;

    status)

    if rc-service &quot;${service}&quot; status | grep -q &quot;started&quot;; then

    echo &quot;Active: active (running) &quot;

    else

    echo &quot;Active: inactive (dead) &quot;

    exit 1

    fi

    ;;

    enable)

    rc-update add &quot;${service}&quot;

    ;;

    disable)

    rc-update del &quot;${service}&quot;

    ;;

    is-enabled)

    if rc-update show | grep -q &quot;^[[:space:]]*${service}&quot;; then

    echo &quot;enabled&quot;

    else

    echo &quot;disabled&quot;

    exit 1

    fi

    ;;

    is-active)

    if rc-service &quot;${service}&quot; status | grep -q &quot;started&quot;; then

    echo &quot;active&quot;

    else

    echo &quot;inactive&quot;

    exit 1

    fi

    ;;

    show)

    echo &quot;OpenRC does not support 'show' directly. Check service files in /etc/init.d or /etc/conf.d.&quot; 

    ;;

    list-units)

    rc-update show

    ;;

    *)

    print_usage &quot;${action}&quot;

    ;;

    esac











修改属性：


chmod +x /usr/local/bin/systemctl






4.保存


nano /etc/init.d/1panel-core

XML/HTML代码


    #!/sbin/openrc-run

     

    directory=$(grep BASE_DIR= /usr/local/bin/1pctl 2&gt;/dev/null | awk -F= '{print $2&quot;/1panel&quot;}')

    directory=${directory:-/opt/1panel}

    command=&quot;/usr/bin/1panel-core&quot;

    command_background=true

    description=&quot;1Panel, a modern open source linux panel&quot;

    rc_ulimit=&quot;-n 50000&quot;

    rc_cgroup_cleanup=&quot;yes&quot;

    required_dirs=${directory}

    required_files=${command}

    pidfile=&quot;/var/run/${RC_SVCNAME}.pid&quot;

     

    depend() {

    need networking

    use logger dns

    after firewall syslog

    }











修改属性：


chmod +x /etc/init.d/1panel-core






5保存


nano /etc/init.d/1panel-agent

XML/HTML代码


    #!/sbin/openrc-run

     

    directory=$(grep BASE_DIR= /usr/local/bin/1pctl 2&gt;/dev/null | awk -F= '{print $2&quot;/1panel&quot;}')

    directory=${directory:-/opt/1panel}

    command=&quot;/usr/bin/1panel-agent&quot;

    command_background=true

    description=&quot;1Panel, a modern open source linux panel&quot;

    rc_ulimit=&quot;-n 50000&quot;

    rc_cgroup_cleanup=&quot;yes&quot;

    required_dirs=${directory}

    required_files=${command}

    pidfile=&quot;/var/run/${RC_SVCNAME}.pid&quot;

     

    depend() {

    need networking

    use logger dns

    after firewall syslog

    }











修改属性：


chmod +x /etc/init.d/1panel-agent


6..按正常方式安装1panel


XML/HTML代码


    bash -c &quot;$(curl -sSL https://resource.fit2cloud.com/1panel/package/v2/quick_start.sh)&quot;





安装后会停留在中途，不显示最后的各类信息，可以CTRL+C强行中止，再重启一下系统，就可以正常登录后台。


</p><p>
<a href="index.php?action=login&amp;hash=">立即登陆发表评论</a><br />
</p>
<p><a href="index.php?action=list&amp;hash=">返回日志列表</a><br /><a href="index.php?action=index&amp;hash=">返回主页</a></p>
</card>
</wml>
