Static Hosting on Codeberg

Static Hosting on Codeberg

Table of Contents

How to host a static page in Codeberg

1. Register at Codeberg.

2. Add SSH Key pair to your environement.

a. Write this into your terminal to generate the ssh key.

```
ssh-keygen -t ed25519 -C "your_email@example.com"
```

b. You will be asked to enter the filename for ssh files.
```
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/atulya/.ssh/id_ed25519): /home/atulya/.ssh/id_ed25519ForCodeBerg
```

c. Then enter your passphrase.
```
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
``` 

d. After completing the process it will prompt
```
 Your identification has been saved in /home/atulya/.ssh/id_ed25519ForCodeBerg
Your public key has been saved in /home/atulya/.ssh/id_ed25519ForCodeBerg.pub
The key fingerprint is:
SHA256:tDwMcdY8ns5X05fTKfYkILnumP
The key's randomart image is:
+--[ED25519 256]--+
|  .E+oo *o.      |
|   oo. O ++.     |
|      . =.oo.  .+|
|       B oo  +o=+|
+----[SHA256]-----+

```
SSH key pair has been generated sucessfully!

e. Adding the public part of key pair to Codeberg.

Codeberg provides offical steps for hosting read it here.

3. Create new repository namely ‘pages’.

![New Project Menu](Screenshot%20from%202023-07-31%2017-34-51.png)

4. Clone the repo using SSH 😎.

```
git clone git@codeberg.org:username/pages.git
```

5. ‘cd’ into it and create your website

6. Push

git add .
git commit -m "My beautiful website"
git push

https://USERNAME.codeberg.page[/REPOSITORY][/@BRANCH] as https://USERNAME.codeberg.page/REPOSITORY/@BRANCH

8. Your site is live!

Tags :