|
| 1 | +--- |
| 2 | +title: Quickstart Ampup |
| 3 | +description: Build with Amp with Ampup |
| 4 | +slug: quickstart/ampup |
| 5 | +command: ampup |
| 6 | +category: quickstart |
| 7 | +--- |
| 8 | + |
| 9 | +This quickstart helps you jump start Amp locally |
| 10 | + |
| 11 | +## Prerequisites |
| 12 | + |
| 13 | +1. Repository Setup |
| 14 | + |
| 15 | +```bash |
| 16 | +git clone <repository-url> |
| 17 | +cd <repository-name>` |
| 18 | +``` |
| 19 | + |
| 20 | +2. PostgreSQL database Setup |
| 21 | + |
| 22 | +You need this database to store metadata. |
| 23 | +The easiest way to set this up is by using **Docker**. |
| 24 | + |
| 25 | +### Steps |
| 26 | + |
| 27 | +1. From the root of the `amp` repository, start the PostgreSQL service: |
| 28 | + |
| 29 | +```bash |
| 30 | + docker-compose up -d db |
| 31 | +``` |
| 32 | + |
| 33 | +This command starts PostgreSQL in the background. |
| 34 | + |
| 35 | +2. Verify that the PostgreSQL container is running: |
| 36 | + |
| 37 | +```bash |
| 38 | +docker ps | grep postgres |
| 39 | +``` |
| 40 | + |
| 41 | +## Step-by-step |
| 42 | + |
| 43 | +### Installation via Ampup |
| 44 | + |
| 45 | +1. Use `ampup`, the official version manager and installer: |
| 46 | + |
| 47 | +```sh |
| 48 | +curl --proto '=https' --tlsv1.2 -sSf https://ampup.sh/install | sh |
| 49 | +``` |
| 50 | + |
| 51 | +This will install `ampup` and the latest version of `ampd`. You may need to restart your terminal or run `source ~/.zshenv` (or your shell's equivalent) to update your PATH. |
| 52 | +
|
| 53 | +Once installed, you can manage `ampd` versions: |
| 54 | +
|
| 55 | +```sh |
| 56 | +# Install or update to the latest version |
| 57 | +ampup install |
| 58 | +
|
| 59 | +# Switch between installed versions |
| 60 | +ampup use |
| 61 | +``` |
| 62 | +
|
| 63 | +> For more details and advanced options, see `ampup --help`. |
| 64 | +
|
| 65 | +### Installation via Nix |
| 66 | +
|
| 67 | +> This will be supported once the source repository has been released |
| 68 | +
|
| 69 | +For Nix users, `ampd` is available as a flake: |
| 70 | +
|
| 71 | +```sh |
| 72 | +# Run directly without installing |
| 73 | +nix run github:edgeandnode/amp |
| 74 | +
|
| 75 | +# Install to your profile |
| 76 | +nix profile install github:edgeandnode/amp |
| 77 | +
|
| 78 | +# Try it out temporarily |
| 79 | +nix shell github:edgeandnode/amp -c ampd --version |
| 80 | +``` |
| 81 | +
|
| 82 | +#### Add Configurations |
| 83 | +
|
| 84 | +You can also add amp to your NixOS or home-manager configuration: |
| 85 | +
|
| 86 | +```nix |
| 87 | +{ |
| 88 | + inputs = { |
| 89 | + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; |
| 90 | + amp = { |
| 91 | + url = "github:edgeandnode/amp"; |
| 92 | + inputs.nixpkgs.follows = "nixpkgs"; |
| 93 | + }; |
| 94 | + }; |
| 95 | +
|
| 96 | + outputs = { nixpkgs, amp, ... }: { |
| 97 | + # NixOS configuration |
| 98 | + nixosConfigurations.myhost = nixpkgs.lib.nixosSystem { |
| 99 | + # ... |
| 100 | + environment.systemPackages = [ |
| 101 | + amp.packages.${system}.ampd |
| 102 | + ]; |
| 103 | + }; |
| 104 | +
|
| 105 | + # Or home-manager configuration |
| 106 | + home.packages = [ |
| 107 | + amp.packages.${system}.ampd |
| 108 | + ]; |
| 109 | + }; |
| 110 | +} |
| 111 | +``` |
| 112 | +
|
| 113 | +> Note: Nix handles version management, so `ampup` is not needed for Nix users. |
| 114 | +
|
| 115 | +### Building from Source (Manual) |
| 116 | +
|
| 117 | +> This will be supported once the source repository has been released |
| 118 | +
|
| 119 | +If you prefer to build manually without using `ampup`: |
| 120 | +
|
| 121 | +```sh |
| 122 | +cargo build --release -p ampd |
| 123 | +``` |
| 124 | +
|
| 125 | +The binary will be available at `target/release/ampd`. |
0 commit comments