|
| 1 | +# AWS AMI |
| 2 | + |
| 3 | +Openblocks provides an Amazon Machine Image (AMI) for your self-hosting on [Amazon Web Services (AWS)](https://aws.amazon.com/). |
| 4 | + |
| 5 | +## Deploy |
| 6 | + |
| 7 | +1. Sign in to [Amazon Web Services (AWS)](https://aws.amazon.com/) or [Create and activate an AWS account](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/?nc1=h\_ls) first. |
| 8 | +2. Follow the steps in [Create a key pair using Amazon EC2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html#having-ec2-create-your-key-pair) to generate an SSH key pair. |
| 9 | + |
| 10 | + <figure><img src="../.gitbook/assets/aws-ami-1.png" alt=""><figcaption></figcaption></figure> |
| 11 | +3. Follow the steps in [Create a security group](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/working-with-security-groups.html#creating-security-group) to create a new AWS security group. While creating, add an inbound rule that sets port **3000** to be accessible from **anywhere**, as shown below. |
| 12 | + |
| 13 | + <figure><img src="../.gitbook/assets/aws-ami-2.png" alt=""><figcaption></figcaption></figure> |
| 14 | +4. Click **Images** -> **AMI Catalog** on the left sidebar. Type in **Openblocks** to search in **AWS Marketplace AMIs**. **Select** the Openblocks image from results, then click the **Launch Instance with AMI** button to proceed. |
| 15 | + |
| 16 | + <figure><img src="../.gitbook/assets/aws-ami-3.png" alt=""><figcaption></figcaption></figure> |
| 17 | +5. Configure the following settings: |
| 18 | + |
| 19 | + 1. Choose your desired **Instance type**. We'd recommend a system spec with 1 core CPU and 2 GB RAM or the above. |
| 20 | + 2. Select the **key pair** created in step 2. |
| 21 | + 3. **Enable** auto-assigning public IP. |
| 22 | + 4. Select the **security group** created in step 3. |
| 23 | + |
| 24 | + <figure><img src="../.gitbook/assets/aws-ami-4.png" alt=""><figcaption></figcaption></figure> |
| 25 | +6. You can check the settings again and click the **Lauch instance** button to proceed. |
| 26 | + |
| 27 | + <figure><img src="../.gitbook/assets/aws-ami-5.png" alt=""><figcaption></figcaption></figure> |
| 28 | + |
| 29 | +It usually takes a few minutes to start the instance. |
| 30 | + |
| 31 | +<figure><img src="../.gitbook/assets/aws-ami-6.png" alt=""><figcaption></figcaption></figure> |
| 32 | + |
| 33 | +After deployment, you can view the instance details on the **Instances** page and get the **public IPv4 address**. |
| 34 | + |
| 35 | +<figure><img src="../.gitbook/assets/aws-ami-7.png" alt=""><figcaption></figcaption></figure> |
| 36 | + |
| 37 | +Your new Openblocks instance should be available at **http://public\_ipv4\_address:3000**.  |
| 38 | + |
| 39 | +In the welcome page, click **Sign up** to get started. Openblocks will automatically create a workspace for you. Then you can start building your apps and invite members to your workspace. |
| 40 | + |
| 41 | +<figure><img src="../.gitbook/assets/aws-ami-8.png" alt=""><figcaption></figcaption></figure> |
| 42 | + |
| 43 | +## Connect to instance |
| 44 | + |
| 45 | +You can connect to your instance to update the image or customize deployment configurations. |
| 46 | + |
| 47 | + Click **Connect** on the **Instances** page. AWS provides four connection options. |
| 48 | + |
| 49 | +<figure><img src="../.gitbook/assets/aws-ami-9.png" alt=""><figcaption></figcaption></figure> |
| 50 | + |
| 51 | +<figure><img src="../.gitbook/assets/aws-ami-10.png" alt=""><figcaption></figcaption></figure> |
| 52 | + |
| 53 | +{% hint style="info" %} |
| 54 | +For detailed information, see [Connect to your Linux instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html). |
| 55 | +{% endhint %} |
| 56 | + |
| 57 | +For example, you can connect to your instance using an SSH client. Locate your private key file and get your public IPv4 DNS. Then run the following command: |
| 58 | + |
| 59 | +```bash |
| 60 | +ssh -i "your_private_key.pem" ubuntu@your_public_IPv4_DNS |
| 61 | +``` |
| 62 | + |
| 63 | +<figure><img src="../.gitbook/assets/aws-ami-11.png" alt=""><figcaption></figcaption></figure> |
| 64 | + |
| 65 | +### Update |
| 66 | + |
| 67 | +For information about how to update the Openblocks image to the latest version, see [Update](./#update). |
| 68 | + |
| 69 | +### Customize deployment configurations |
| 70 | + |
| 71 | +| Location | Usage | |
| 72 | +| ------------------------------------------------------------ | --------------------------------------------------- | |
| 73 | +| <p><code>~/openblocks/docker-compose.yml</code><br></p> | Setting up Docker ports, volumes, environments etc. | |
| 74 | +| `~/openblocks/stacks/configuration/application-selfhost.yml` | Setting up Openblocks server configurations | |
| 75 | + |
| 76 | +For information about how to customize deployment configurations, see [Customize deployment configurations](./#customize-deployment-configurations). |
0 commit comments