



























Scaleway 成立于 1999 年(前身为 Online.net),是法国电信巨头 Iliad 集团旗下的云计算与托管服务提供商,总部位于巴黎。
在其众多产品线中,本文推荐适合低成本长期持有的 STARDUST1-S 型 VPS(俗称「星辰小鸡」)。

本文将引领你创建长期稳定运行的仅 IPv6 的「星辰小鸡」,价格为:
注册 Scaleway 账号时国家可选择中国,需绑定借记卡/信用卡进行 €1.00 的预扣款验证(验证后自动退回)。KYC 身份认证为可选步骤,可提升账户的资源配额,我通过手机扫码上传驾照后完成验证。

新建一个项目,在项目设置中添加你的 SSH 公钥。对于如何生成 SSH 密钥对,本文不作赘述。

Scaleway 目前提供三个国家的数据中心,每个国家下辖三个可用区(Zone)。如果目标区域库存充足,推荐直接在网页控制台创建实例:

为了最大程度压缩成本,仅保留完全免费的 IPv6 地址即可:

确认创建前,留意右侧的服务器预估价格应为 €0.11/月,该价格为不包含存储块费用:

若网页控制台显示各区域均无库存,可尝试通过 API 创建 VPS,这里直接使用 Scaleway 网页控制台的 Cloud Shell (CLI) 操作。

根据需求修改下方命令中的可用区 zone 和实例名称 name,然后执行命令:
# 可选区域 zone:
# 法国巴黎:fr-par-1 | fr-par-2 | fr-par-3
# 荷兰阿姆斯特丹:nl-ams-1 | nl-ams-2 | nl-ams-3
# 波兰华沙:pl-waw-1 | pl-waw-2 | pl-waw-3
scw instance server create zone=fr-par-1 root-volume=local:10GB name=stardust-par type=STARDUST1-S ipv6=true ip=none
执行完毕出现以下输出,代表实例创建成功:

通过此方式创建的 VPS,需手动为实例附加 IPv6 地址:

默认的 10GB 块存储比较贵,我们通过缩减块存储容量来进一步压缩成本。各容量的计费参考如下:
| 容量 (GB) | 月价 (€) | 单价 (€/GB/月) | 价格 (€/年) |
|---|---|---|---|
| 1 GB | 0.03 | 0.0300 | 0.36 |
| 2 GB | 0.06 | 0.0300 | 0.72 |
| 3 GB | 0.10 | 0.0333 | 1.20 |
| 4 GB | 0.13 | 0.0325 | 1.56 |
| 5 GB | 0.16 | 0.0320 | 1.92 |
如果运行 Alpine 系统,1GB 空间已绰绰有余;但若是 Debian 则有点捉襟见肘,通常需要配合 Btrfs 文件系统和 ZSTD 压缩才勉强够用。
为了兼顾体验与成本,我建议直接选择 2GB 存储方案。足以轻松安装 Debian 13,无需折腾系统级压缩,便宜且完全够用。
将服务器关机后,删除默认的 10GB 存储卷:

新建并附加一个新的 2GB 的存储卷,区域与 VPS 保持一致:

目前新挂载的存储卷还是空白的,我们通过救援模式(Rescue Mode)引导,以便手动安装 Debian 13 最小系统。
确保前一步中的存储卷已正确附加至该 VPS,将 VPS 引导模式切换为救援模式:

在网页控制台重启服务器,使用 SSH 登录后,终端输出以下提示信息,则确认已进入救援环境:
This Scaleway instance is currently booted in "rescue" mode, which is
specifically suited for troubleshooting purposes.
If booting in "rescue" mode was *not* your intent, and you expected this
instance to boot normally instead, you should:
1. Stop it
2. Set its _Boot Mode_ (a.k.a. `boot-type`) to "local" rather than "rescue"
3. Start it again
More information on this page:
https://www.scaleway.com/en/docs/compute/instances/how-to/use-boot-modes/#how-to-use-local-boot
若打算安装 Alpine Linux 进一步降降低磁盘大小需求(1GB 足矣),另请参阅 Scaleway VPS 安装 Alpine Linux 。
检查当前磁盘挂载状态:
输出示例如下:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 9.3G 1 disk
├─sda1 8:1 0 3.5G 1 part /media/root-ro
├─sda14 8:14 0 4M 1 part
├─sda15 8:15 0 106M 1 part /boot/efi
└─sda16 259:0 0 913M 1 part /media/root-ro/boot
vda 253:0 0 1.9G 0 disk
其中:
sda 是 Scaleway 救援系统的系统盘vda 是附加的空白存储块,用于安装新系统建立新的分区表与挂载点:
# 释放挂载并清空磁盘
umount -R /mnt 2>/dev/null
wipefs -a /dev/vda
# 磁盘分区
parted -s /dev/vda mklabel gpt
parted -s /dev/vda mkpart ESP fat32 1MiB 101MiB
parted -s /dev/vda set 1 esp on
parted -s /dev/vda mkpart primary ext4 101MiB 100%
# 格式化分区
mkfs.fat -F32 /dev/vda1
mkfs.ext4 /dev/vda2
# 挂载目录
mount /dev/vda2 /mnt
mkdir -p /mnt/boot/efi
mount /dev/vda1 /mnt/boot/efi
使用 debootstrap 安装 Debian 系统的基础软件:
apt update
apt install -y debootstrap arch-install-scripts
debootstrap --arch=amd64 --variant=minbase \
--components=main,contrib,non-free-firmware \
--include=systemd,systemd-sysv,ca-certificates,curl,dbus \
trixie /mnt http://deb.debian.org/debian
核心文件就绪后,切换到新系统环境进行引导、网络和账户的必要配置:
# 生成 fstab 挂载表
genfstab -U /mnt >> /mnt/etc/fstab
# 挂载虚拟文件系统
for i in /dev /dev/pts /proc /sys /run; do mount -B $i /mnt$i; done
# 清空 DNS 设置
rm -f /mnt/etc/resolv.conf
# 设置 IPv6 DNS
cat <<EOF > /mnt/etc/resolv.conf
nameserver 2606:4700:4700::1111
nameserver 2606:4700:4700::1001
EOF
# chroot 进入新系统
chroot /mnt /bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# 设置主机名
echo "paris-star" > /etc/hostname
# 设置本地解析
cat <<EOF > /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
127.0.1.1 paris-star
EOF
# 写入 Debian 13 官方源
cat <<EOF > /etc/apt/sources.list
deb http://deb.debian.org/debian trixie main contrib non-free-firmware
deb http://deb.debian.org/debian-security trixie-security main contrib non-free-firmware
deb http://deb.debian.org/debian trixie-updates main contrib non-free-firmware
EOF
# 更新源
apt update && apt upgrade -y
# 安装核心软件包,使用 cloud 内核占用资源更低
apt install -y e2fsprogs linux-image-cloud-amd64 grub-efi-amd64-signed shim-signed efibootmgr openssh-server systemd-resolved iproute2 iputils-ping
# 修改 GRUB 引导参数
cat <<EOF > /etc/default/grub
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Debian"
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0,115200"
GRUB_CMDLINE_LINUX=""
GRUB_TERMINAL="console serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
EOF
# 准备 Grub 目录
mkdir -p /boot/grub
# 安装 GRUB 引导核心
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=debian --recheck --no-floppy --removable
# 生成 GRUB 引导
update-grub
# 配置 IPv6 DHCP 支持
mkdir -p /etc/systemd/network
cat <<EOF > /etc/systemd/network/20-wired.network
[Match]
Name=en*
[Network]
DHCP=ipv6
IPv6AcceptRA=yes
EOF
# 重载网络配置
systemctl enable systemd-networkd
# 设置 Root 密码
passwd root
# 临时配置 SSH 允许 Root 密码登录
sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
sed -i 's/^#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
# 清理缓存
apt clean
# 退出 Chroot 环境并卸载磁盘
exit
umount -R /mnt
sync
# 关机
poweroff
VPS 关机后,在 Scaleway 控制台将引导模式切回 Normal (Local) Mode 并重新启动,然后使用 SSH 登录新系统。
创建普通用户并配置 sudo 免密权限:
apt install -y sudo
# 创建普通用户 dejavu
adduser dejavu
# 设置 sudo 免密权限
echo "dejavu ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/dejavu
chmod 0440 /etc/sudoers.d/dejavu
配置 UTF-8 本地化环境:
sudo apt install -y locales
sudo sed -i 's/^# *\(en_US.UTF-8 UTF-8\)/\1/' /etc/locale.gen
sudo locale-gen
sudo update-locale LANG=en_US.UTF-8
export LANG=en_US.UTF-8
设置时区同步:
sudo timedatectl set-timezone UTC
sudo apt update
sudo apt install -y systemd-timesyncd
sudo vim /etc/systemd/timesyncd.conf
# 修改 [Time] 字段如下:
[Time]
NTP=time.cloudflare.com time.google.com
FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org
# 重启对时服务
sudo systemctl restart systemd-timesyncd
# 查看系统当前的时间同步状态
timedatectl status
系统日志控制:
sudo sed -i 's/^#SystemMaxUse=.*/SystemMaxUse=20M/' /etc/systemd/journald.conf
sudo sed -i 's/^#SystemMaxFileSize=.*/SystemMaxFileSize=5M/' /etc/systemd/journald.conf
sudo sed -i 's/^#MaxRetentionSec=.*/MaxRetentionSec=1week/' /etc/systemd/journald.conf
# 重启使其立刻生效,并主动清理一次
sudo systemctl restart systemd-journald
sudo journalctl --vacuum-size=20M
# 日志轮转
sudo apt update && sudo apt install logrotate
# 解除全局压缩的注释
sudo sed -i 's/^#compress/compress/' /etc/logrotate.conf
# 更激进的压缩选项
sudo sed -i 's/^#compressext/compressext .gz/' /etc/logrotate.conf
如果安装了 Nginx,设置日志轮转:
# 保留 3 天日志,每天轮转
sudo sed -i 's/rotate .*/rotate 3/' /etc/logrotate.d/nginx
sudo sed -i 's/weekly/daily/' /etc/logrotate.d/nginx
配置 APT Hooks:
echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' | sudo tee /etc/apt/apt.conf.d/99clean-cache
更多后续配置可参考 新到手的 Linux 服务器,我这样设置 。
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。