In order to host outline wiki for free, I will be using these four free services :
- Server : AWS free tier
- Postgres database : Supabase
- Redis database : Redis Labs
- S3 Storage: AWS S3 (included in the AWS free tier with 5GB storage).
I tried Oracle and AWS for server. It was a hassle to signup to oracle, so I went with AWS.
For free postgresql database my favorite choice is Supabase.
For redis database you can either go with Redis Labs or Upstash.
With the AWS free tier, you get 5GB of S3 storage for 12 months, sufficient for Outline’s file storage needs. The EC2 instance includes 30GB of EBS storage for the server.
The setup is free. However there are few limitiations
- AWS EC2: 750 hours/month for 12 months.
- Supabase: 500MB database size, 1GB data transfer.
- Redis Labs: 30MB storage, limited connections.
- S3: 5GB storage, 20,000 GET requests, 2,000 PUT requests.
1. Create an EC2 Instance
In your AWS console search for ec2, on clicking you will get this kind of interface.
Please give a name to the server. I want you to choose ubuntu ami in AMI settings.
I recommend the Ubuntu AMI because its apt package manager is more familiar to most users. Amazon Linux uses dnf, which may require different commands, but it also supports Docker and Docker Compose.
Apart from that you can keep all other options in default mode. You can increase the size of the EBS volume attach to the instance if you want. The default is 8gb. I increased the EBS volume to 16GB to accommodate Outline’s dependencies and potential document storage. 8GB is often sufficient for a lightweight setup.
You need to create a key pair to SSH into the EC2 instance. In the AWS console, under ‘Key Pairs,’ click ‘Create key pair,’ choose .pem format, and download the file. Secure it with chmod 400 key-pair-file.pem
on your local machine.
After downloading the .pem file, run chmod 400 key-pair-file.pem
on your local machine to restrict access. Store it securely and never share it.
After ec2 instance creation, the next step is to connect to the ec2 instance.
2. Connect to ec2 instance.
In order to connect to an ec2 instance there are multiple ways. You can either ssh from your local computer using command prompt. The simplest way to connect is using EC2 instance connect.
EC2 Instance Connect opens a browser-based SSH terminal. Ensure your instance is in a public subnet and has a public IP.
In the AWS console, select your EC2 instance, click ‘Connect,’ and choose ‘EC2 Instance Connect.’ Ensure your security group allows SSH (port 22) from your IP or 0.0.0.0/0 for temporary access.
or you can ssh into the ec2 instance from local computer.
ssh -v -i "outline-server.pem" ubuntu@your-ec2-public-ip
Configure Security Group
After creating the instance, ensure the security group allows:
-
Port 22 (SSH): For connecting to the instance. Set the source to your public IP (e.g.,
your-ip/32
) for security. -
Port 3000 (HTTP): For accessing Outline directly (temporarily allow
0.0.0.0/0
until a reverse proxy is set up). - Port 80 (HTTP) and Port 443 (HTTPS): These will be used after setting up a reverse proxy and SSL (covered in later blogs).
Without the port 3000 rule, you won’t be able to access Outline at http://<ec2-public-ip>:3000
. The port 80 rule doesn’t help yet because Outline isn’t listening on port 80.
3. Install Docker & Docker Compose
After ssh to the client , run the following commands
sudo apt update
sudo apt install -y docker.io docker-compose
sudo usermod -aG docker ubuntu
newgrp docker
Commands Breakdown
sudo apt update
-
apt
is the package manager for Debian/Ubuntu systems. -
update
refreshes the local list of available packages and their versions. - It checks and updates what's available into the local list. It does not install or upgrade anything yet — just fetches the latest info.
sudo apt install -y docker.io docker-compose
-
install
installs the listed packages. -
docker.io
is the package that contains the Docker engine. -
docker-compose
is the tool that lets you define and run multi-container Docker apps using adocker-compose.yml
file. -
-y
auto-answers "yes" to prompts (so it doesn’t stop to ask you during install).
sudo usermod -aG docker ubuntu
-
usermod
modifies a user account. -
-aG docker
adds the user to thedocker
group (which has permission to run Docker commands withoutsudo
). -
ubuntu
is the username you're adding to the Docker group. This allows you to run Docker as a normal user (withoutsudo
)
newgrp docker
- Refreshes your current shell session so the new group membership (i.e., Docker group) takes effect immediately without requiring logout/login.
- Sometimes the
newgrp docker
command may not always work as expected in non-interactive shells. At that time please log out and log back in. Last option is to runexec su -l $USER
to refresh the session.
You can test everything is working with:
sudo systemctl status docker
docker --version
docker-compose --version
docker run hello-world
4. Create a .env
file
nano outline.env
A nano editor will open. You need to update the file with the .env file here
https://github.com/outline/outline/blob/main/.env.sample
These rules are required. You would need an authentication provider. I am using slack here.
# –––––––––––––––– REQUIRED ––––––––––––––––
NODE_ENV=production
SECRET_KEY="64-char-string" # 32-byte hex-encoded random string (64 characters in hexadecimal).
# You can use this link to generate : https://numbergenerator.org/random-32-digit-hex-codes-generator
UTILS_SECRET="64-char-string" # 32-byte hex-encoded random string (64 characters in hexadecimal).
DATABASE_URL="postgresql://postgres_username:postgres_password@host_url:host_port/db_name" # Your postgres db url
REDIS_URL="redis://redi_username:redis_password@host_url:host_port" # An ioredis compatible url
// Note that users can temporarily use the EC2 public IP (e.g., http://ec2-public-ip:3000) and update the .env file later when configuring a domain and SSL.
URL="your_domain_name" # https://outline.your_domain.com
PORT=3000 #keep it as it is
HOST=0.0.0.0 #keep it as it is
COLLABORATION_URL="your_domain_name" # https://outline.your_domain.com if you want multiple users to collaborate then set this same as URL
FILE_STORAGE="s3" # Specify what storage system to use. Possible value is one of "s3" or "local". We will be using S3
FILE_STORAGE_UPLOAD_MAX_SIZE=2147483648
FILE_STORAGE_IMPORT_MAX_SIZE=52428800
FILE_STORAGE_WORKSPACE_IMPORT_MAX_SIZE=104857600
# S3 Access Keys
AWS_ACCESS_KEY_ID="s3-access-key-id"
AWS_SECRET_ACCESS_KEY="s3-access-key-secret"
AWS_REGION="s3-region"
AWS_S3_ACCELERATE_URL=
AWS_S3_UPLOAD_BUCKET_URL="s3-url"
AWS_S3_UPLOAD_BUCKET_NAME="s3-bucket-name"
AWS_S3_FORCE_PATH_STYLE=true
AWS_S3_ACL=private
# –––––––––––––– AUTHENTICATION ––––––––––––––
SLACK_CLIENT_ID="slack-client-id"
SLACK_CLIENT_SECRET="slack-client-secret"
5. Create a docker compose file
Create docker-compose.yml file in root
nano docker-compose.yml
version: "3"
services:
outline:
image: outlinewiki/outline:
env_file:
- outline.env
ports:
- "3000:3000"
restart: always
It's better to pin the image to a specific version. Docker image pulls the latest version, which could break if Outline releases a new version with breaking changes. Something like outlinewiki/outline:0.81.0
instead of outlinewiki/outline
is better.
Start it:
docker-compose up -d
This should start the server with docker.
Further Setup
- Postgresql setup & Redis url setup
- S3 setup : S3 is an AWS service included in the AWS free tie
- SSL setup
- Reverse proxy setup
I will try to post these blogs as soon as possible. This is the first blog in this series.
Possible Errors
These are few errors that you might face
- Make sure to choose .pem format. If you choose .ppk format you need to install putty for windows. If you accidentally chose .ppk, use PuTTYgen to convert the .pem file to .ppk for use with PuTTY on Windows.
- Make sure that the region is correct in top right corner, before creating an instance. You can't change it after instance creation. Please select a region closest to your location.
- The ssh user name is different based on ami (amazon machine image). For amazon linux, it's ec2-user and for ubuntu its ubuntu.
Top comments (0)