-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
70 lines (59 loc) · 1.75 KB
/
install.sh
File metadata and controls
70 lines (59 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
set -e
echo "========================================"
echo "OpenHands LLM Enhanced - Setup"
echo "========================================"
echo ""
# Check Docker
if ! command -v docker &> /dev/null; then
echo "ERROR: Docker is not installed."
echo "Install Docker: https://docs.docker.com/get-docker/"
exit 1
fi
if ! docker info &> /dev/null; then
echo "ERROR: Docker is not running. Start Docker and try again."
exit 1
fi
# Check for .env
if [ ! -f .env ]; then
if [ -f .env.example ]; then
cp .env.example .env
echo "Created .env from .env.example."
echo ""
echo "IMPORTANT: Edit .env and set your LLM_API_KEY before running!"
echo " nano .env (or use any text editor)"
echo ""
echo "Then re-run: ./install.sh"
exit 0
else
echo "ERROR: No .env or .env.example found."
exit 1
fi
fi
# Check API key is set
if grep -q "sk-your-api-key-here" .env; then
echo "ERROR: You haven't set your API key yet."
echo " Edit .env and replace 'sk-your-api-key-here' with your actual key."
exit 1
fi
# Create project directory
mkdir -p project
echo "Step 1: Building Docker image..."
echo "(First build pulls ~2GB base image — may take a few minutes)"
echo ""
docker compose build
echo ""
echo "Step 2: Starting..."
echo ""
docker compose up -d
echo ""
echo "========================================"
echo " OpenHands is starting!"
echo " Open: http://localhost:${EXTERNAL_PORT:-3333}"
echo " (First conversation builds sandbox — takes a few minutes)"
echo "========================================"
echo ""
echo "Commands:"
echo " Stop: docker compose down"
echo " Logs: docker logs openhands-llm-app"
echo " Restart: docker compose up -d"