I’m trying out the document server. I installed the developer version of the docker image to test with using
sudo docker run -i -t -d -p 80:80 --restart=always onlyoffice/documentserver-de
Then I looked up the JWT secret that it generated using
docker exec fa3de342eca4 sudo documentserver-jwt-status.sh
which turned out to be ZUFWiLvQ7tnJzaagPhd0zURDH544Eblp
(This is all on localhost and ephemeral, so I don’t care about sharing it).
I confirmed that the document server is alive on http://localhost/welcome/. That page comes up just fine.
I then created a simple html page based on the sample here. Opening file | ONLYOFFICE
and it looks like this:
<html>
<head>
<script type="text/javascript" src="http://localhost//web-apps/apps/api/documents/api.js"></script>
</head>
<body>
<div id="placeholder"></div>
<script>
const config = {
document: {
fileType: "docx",
key: "Khirz6zTPdfd7",
title: "Example Document Title.docx",
url: "c:\mylocalfile.docx",
},
documentType: "word",
token:"ZUFWiLvQ7tnJzaagPhd0zURDH544Eblp",
};
const docEditor = new DocsAPI.DocEditor("placeholder", config);
</script>
</body>
</html>
But when I open that html file, I get the error “The document security token is not correctly formed. Please contact your document server administrator.”.
In the docker logs I see this entry:
[2025-09-15T17:24:42.542] [WARN] [localhost] [Khirz6zTPdfd7] [userId] nodeJS - checkJwt error: name = JsonWebTokenError message = jwt malformed token = ZUFWiLvQ7tnJzaagPhd0zURDH544Eblp
Can someone please explain what I’m doing wrong?