Skip to content

Install

Lajos Sánta edited this page Mar 21, 2023 · 2 revisions

Requirements

  • python v3.10
  • virtualenv (optional, but recommended)

Create virtualenv (optional)

  • sudo pip install virtualenv
  • pick some folder for the virtualenv's files (eg /var/www/claude)
  • virtualenv /var/www/claude
  • source /var/www/claude/bin/activate

Install claude

  • pip install claude-0.4.2.tar.gz

Systemd service (optional)

  • make writable /var/www/claude/ by the www-data user (chown www-data /var/www/claude/)
  • create a proper Claude config file in /var/www/claude/config.yaml
  • create systemd service file /etc/systemd/system/claude.service with this content:
[Unit]
Description=Claude service
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=1
User=www-data
Environment=CLAUDE_CONFIG_FILE=/var/www/claude/config.yaml
ExecStart=/var/www/claude/bin/uvicorn claude.app:get_app --factory --port 5002 --workers 4 --host 0.0.0.0

[Install]
WantedBy=multi-user.target
  • start: systemctl start claude
  • automatically get it to start on boot systemctl enable claude
  • Follow logs: journalctl -u claude.service -f

Nginx reverse proxy (optional)

  • server config example for nginx
server {
    listen 80;

    server_name your.name.local;

    location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_redirect off;
        proxy_buffering off;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;

        proxy_pass          http://127.0.0.1:5002;
    }
}

Start the dashboard on raspberry pi on start

file: /etc/xdg/lxsession/LXDE-pi/autostart

(the xset lines to about disable screen saver and screen blank, etc)

extra content:

@xset s off
@xset -dpms
@xset s noblank

@chromium-browser --start-fullscreen --start-maximized http://your.name.local/

Clone this wiki locally